๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Welcome.

:: Python ๐Ÿšฉ/์•Œ๊ณ ๋ฆฌ์ฆ˜4

BFS & DFS stack = [] stack.append(5) #push 5 stack.append(2) #push 2 stack.append(3) #push 3 stack.append(7) #push 7 stack.pop() stack.append(1) #push 1 stack.append(4) #push 4 stack.pop() print(stack[::-1]) #์ตœ์ƒ๋‹จ ์›์†Œ๋ถ€ํ„ฐ ์ถœ๋ ฅ print(stack) #์ตœํ•˜๋‹จ ์›์†Œ๋ถ€ํ„ฐ ์ถœ๋ ฅ from collections import deque queue = deque() queue.append(5) queue.append(2) queue.append(3) queue.append(7) queue.popleft() queue.append(1) queue.append(4) que.. 2023. 2. 16.
[์ฝ”๋”ฉ] [๋ฐฑ์ค€ 2884 python] https://www.acmicpc.net/problem/2884 2884๋ฒˆ: ์•Œ๋žŒ ์‹œ๊ณ„ ์ƒ๊ทผ์ด๋Š” ๋งค์ผ ์•„์นจ ์•Œ๋žŒ์„ ๋“ฃ๊ณ  ์ผ์–ด๋‚œ๋‹ค. ์•Œ๋žŒ์„ ๋“ฃ๊ณ  ๋ฐ”๋กœ ์ผ์–ด๋‚˜๋ฉด ๋‹คํ–‰์ด๊ฒ ์ง€๋งŒ, ํ•ญ์ƒ ์กฐ๊ธˆ๋งŒ ๋” ์ž๋ ค๋Š” ๋งˆ์Œ ๋•Œ๋ฌธ์— ๋งค์ผ ํ•™๊ต๋ฅผ ์ง€๊ฐํ•˜๊ณ  ์žˆ๋‹ค. ์ƒ๊ทผ์ด๋Š” ๋ชจ๋“  ๋ฐฉ๋ฒ•์„ ๋™์›ํ•ด๋ณด์•˜์ง€๋งŒ, www.acmicpc.net h, m = map(int, input().split()) if 45 2023. 1. 19.
[์ฝ”๋”ฉ] [๋ฐฑ์ค€ 14681 python] https://www.acmicpc.net/problem/14681 x = int(input()) y = int(input()) if 0 < x : if 0 < y: print("1") if y < 0 : print("4") if x < 0 : if 0 < y: print("2") if y < 0: print("3") 2023. 1. 19.
[์ฝ”๋”ฉ] [๋ฐฑ์ค€ 10808 python] https://www.acmicpc.net/problem/18108 num = int(input()) num = num - 543 print(num) 2023. 1. 19.
728x90