본문 바로가기

백준2379

[백준/파이썬] 25558번 내비게이션 -Coden = int(input())s_x, s_y, e_x, e_y = map(int, input().split())res = []for _ in range(n): m = int(input()) points = [list(map(int, input().split())) for _ in range(m)] points.append([e_x, e_y]) now_x, now_y = s_x, s_y total = 0 for point in points: total += abs(now_x - point[0]) + abs(now_y - point[1]) now_x, now_y = point[0], point[1] res.append(total)prin.. 2025. 2. 12.
[백준/파이썬] 33164번 どら焼き (Dorayaki) -Coden, m = map(int, input().split())a_list = list(map(int, input().split()))b_list = list(map(int, input().split()))res = 0for i in range(n): for j in range(m): res += (a_list[i] + b_list[j]) * max(a_list[i], b_list[j])print(res) 2025. 2. 11.
[백준/파이썬] 33167번 じゃんけん (Rock-Scissors-Paper) -Codedef solution(a, b): if a == b: return 0 elif ( (a == "R" and b == "S") or (a == "S" and b == "P") or (a == "P" and b == "R") ): return 1 return -1n = int(input())ao = input()bt = input()ao_p, bt_p = 0, 0for i in range(n): if solution(ao[i], bt[i]) == 1: ao_p += 1 elif solution(ao[i], bt[i]) == -1: bt_p += 1print(.. 2025. 2. 10.
[백준/파이썬] 27240번 Электричка -Coden, a, b = map(int, input().split())s, t = map(int, input().split())if a = b and t >= b): print("Outside")else: print("Full") 2025. 2. 9.
[백준/파이썬] 5246번 Virus Outbreak -Codewhile True: dp = [0, 1] t = int(input()) if t == -1: break for _ in range(1, t): dp.append(dp[-1] + dp[-2]) print(f"Hour {t}: {dp[t]} cow(s) affected") 2025. 2. 8.
[백준/파이썬] 5246번 Checkerboard Rows -Codefor _ in range(int(input())): p_list = list(map(int, input().split())) column = {} for i in range(1, len(p_list), 2): x, y = p_list[i], p_list[i + 1] if y not in column: column[y] = 1 else: column[y] += 1 print(max(column.values())) 2025. 2. 7.