๋์ ์ฝ๋ t = int(input()) for tc in range(1,t+1): n = int(input()) lt = n//2 rt = n//2 result = 0 for _ in range(n//2): arr = list(map(int,input())) result += sum(arr[lt:rt+1]) lt -= 1 rt += 1 for _ in range(n//2,n): arr = list(map(int,input())) result += sum(arr[lt:rt+1]) lt += 1 rt -= 1 print("#"+str(tc) , result ) ์ฝ๋๊ฐ ๋๋ฌด ์ง์ ๋ถํด์ ๋ค์ ํ์๋ค. ์์ ์ฝ๋ t = int(input()) for tc in range(1,t+1): n = int(input()..
๋์ ์ฝ๋ for _ in range(10): t = int(input()) arr = [] for _ in range(100): tmp = list(map(int,input().split())) arr.append(tmp) large = 0 c = [] d = [] for i in range(100): if sum(arr[i]) > large : large = sum(arr[i]) b = [j[i] for j in arr] if sum(b) > large : large = sum(b) c.append(arr[i][i]) d.append(arr[i][99-i]) result = max(large,sum(c),sum(d)) print("#"+str(t) , result) ํ, ์ด, ๋๊ฐ์ 1, ๋๊ฐ์ 2 ๊ฐ๊ฐ..
๋์ ์ฝ๋ for t in range(1, 11): n,s = input().split() n = int(n) + 2 arr = list(s) flag = True while flag: n -= 2 for i in range(n-1): if arr[i] == arr[i+1]: arr.pop(i) arr.pop(i) break else: flag = False print("#"+str(t) ," ", *arr , sep="") ๋ฐฐ์ด์์ ๋ฐ๋ณต๋ฌธ์ ์ํํ์ฌ ๋ค์ ์ธ๋ฑ์ค์ ๊ฐ์ด ๊ฐ์ผ๋ฉด ๋๋ค ์๊ฑฐ pop() ๋ฐ๋ณต๋ฌธ์ ๊ธธ์ด๋ ๊ฐ์์ํด n -= 2 ๋ฐฐ์ด์์ ๋์ด์ ์๊ฑฐํ ๋ฒํธ ์์ด ์์ผ๋ฉด while ๋ฐ๋ณต๋ฌธ์ ์ข ๋ฃ ์ํค๊ธฐ ์ํด flag ๋ณ์๋ฅผ ์ด์ฉ for-else ๋ฌธ for i in range(5): print(i, ..
๋์ ์ฝ๋ T = int(input()) for t in range(1, T + 1): arr = list(map(int,input().split())) cnt = [0]*101 result = 0 for x in arr: cnt[x] += 1 for i in range(len(cnt)): if cnt[i] ==1 or cnt[i] ==3 : result = i print("#"+str(t) , result) ์ ๋ ฅ๋ฐ์ ์๋ฅผ ์นด์ดํ ํ๋ค. ์ง์ง ๋ฉ์ฒญํ๊ฒ ํ์๋ค. ์ฝ๋ ์์ T = int(input()) for t in range(1, T + 1): arr = list(map(int,input().split())) arr.sort() result = 0 if arr[0] == arr[1]: result = a..
๋์ ์ฝ๋ 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..