백준2338 [백준/파이썬] 32089번 部員の変遷 -Codewhile True: n = int(input()) if n == 0: break a_list = list(map(int, input().split())) res = 0 for i in range(n - 2): res = max(res, sum(a_list[i:i + 3])) print(res) 2024. 7. 19. [백준/파이썬] 6500번 랜덤 숫자 만들기 -Codewhile True: a = int(input()) if a == 0: break res = [a] while True: a = str(a ** 2) a = int(('0' * (8 - len(a)) + a)[2:-2]) if a in res: break res.append(a) print(len(res)) 2024. 7. 18. [백준/파이썬] 13063번 Lobby -Codewhile True: n, m, k = map(int, input().split()) if n == m == k == 0: break other = n - m - k half = n // 2 + 1 if half - m > other: print(-1) else: print(max(half - m, 0)) 2024. 7. 17. [백준/파이썬] 30314번 Just a Joystick -Coden = int(input())line1 = input()line2 = input()res = 0for i in range(n): distance = abs(ord(line1[i]) - ord(line2[i])) res += min(distance, 26 - distance)print(res) 2024. 7. 16. [백준/파이썬] 32046번 Snacks within 300 Yen -Codewhile True: n = int(input()) if n == 0: break res = 0 snacks = list(map(int, input().split())) for p in snacks: if res + p 2024. 7. 15. [백준/파이썬] 32025번 체육은 수학과목 입니다 -Codeh = int(input())w = int(input())print(int(min(h, w) / 2 * 100)) 2024. 7. 14. 이전 1 ··· 30 31 32 33 34 35 36 ··· 390 다음