๋์ ์ฝ๋ from collections import deque for _ in range(1, 11): t = int(input()) arr = list(map(int,input().split())) deq = deque(arr) while 0 not in deq: for i in range(1,6): tmp = deq.popleft() if tmp-i
๊ฐ์ฅ ๊ธด ํ๋ฌธ์ ๊ธธ์ด๋ฅผ ๊ตฌํ๋ ๋ฌธ์ ๋์ ์ฝ๋ for _ in range(10): t = int(input()) arr = [] result = 0 for _ in range(100): arr.append(input()) for i in range(100): b = [x[i] for x in arr] for j in range(100): for length in range(1,101): if j+length > 100: break tmp1 = arr[i][j:j+length] tmp2 = b[j:j+length] if tmp1 == tmp1[::-1] and length > result: result = length if tmp2 == tmp2[::-1] and length > result: result..
๋์ ์ฝ๋ for t in range(1,11): length = int(input()) arr = [] cnt = 0 for _ in range(8): arr.append(input()) for j in range(8): b = [i[j] for i in arr] for i in range(0,9-length): if list(arr[j][i:length+i]) == list(reversed(arr[j][i:length+i])): cnt += 1 if list(b[i:length+i]) == list(reversed(b[i:length+i])): cnt += 1 print("#"+str(t) , cnt) 2์ฐจ์ ๋ฐฐ์ด์์ ํ ์ถ๋ ฅํ๊ธฐ a = [ [0, 1], [2, 3], [4, 5], [6, 7], [..
๋์ ์ฝ๋ T = int(input()) # ์ฌ๋ฌ๊ฐ์ ํ ์คํธ ์ผ์ด์ค๊ฐ ์ฃผ์ด์ง๋ฏ๋ก, ๊ฐ๊ฐ์ ์ฒ๋ฆฌํฉ๋๋ค. arr = [ "a" , "e" , "i" , "o" , "u" ] for t in range(1, T + 1): s = input() result = '' for x in s: if x not in arr: result += x print("#"+str(t) , result ) replace() ํจ์ ์๊ฐ ์๋์ ๊ทธ๋ฅ ๋ฌธ์์ด ๋ํ๊ธฐ๋ก ํ์๋ค. replace() ํจ์ a = input() for i in ["a","e","i","o","u"]: a=a.replace(i,"")
๋์ ์ฝ๋ for t in range(1,11): n = int(input()) arr = list(map(int,input().split())) result = 0 for i in range(2,n-2): mid = arr[i] left = max(arr[i-1],arr[i-2]) right = max(arr[i+1],arr[i+2]) if mid > left and mid > right : result += mid - max(left,right) print("#"+str(t) , result ) ์ผ์ชฝ, ์ค๋ฅธ์ชฝ, ๊ฐ๊ฐ ๋น๊ตํ๋๋ฐ ๊ทธ๋ดํ์๊ฐ ์์๋ค ์ด์ฐจํผ ๊ธฐ์ค์ด ์ ์ผ ๋์์ผ๋๋๊น ใ ใ ๋ค๋ฅธ ์ฌ๋ ํ์ด for T in range(1, 11): n=int(input()) data=list(map(int, i..