파이썬2193 [백준/파이썬] 14969번 Taro's Shopping -Codewhile True: n, m = map(int, input().split()) if n == m == 0: break price = list(map(int, input().split())) res = -1 for i in range(n - 1): for j in range(i + 1, n): sum_price = price[i] + price[j] if sum_price 2024. 7. 11. [백준/파이썬] 27194번 Meeting Near the Fountain -Codefrom math import ceiln, t = map(int, input().split())m = int(input())x, y = map(int, input().split())out_time = m / (60 * x)in_time = (n - m) / (60 * y)res = max(out_time + in_time - t, 0)print(ceil(res)) 2024. 7. 10. [백준/파이썬] 26122번 가장 긴 막대 자석 -Coden = int(input())s = input()arr, cnt = [0], 1for i in range(1, len(s)): if s[i - 1] == s[i]: cnt += 1 else: arr.append(cnt) cnt = 1arr.append(cnt)res = 0for i in range(1, len(arr)): res = max(res, min(arr[i - 1], arr[i]))print(res * 2) 2024. 7. 9. [백준/파이썬] 24198번 Muffinspelet -Coden = int(input())res, cnt = [0, 0], 0while n: cnt += 1 res[cnt % 2] += (n + 1) // 2 n //= 2print(*res) 2024. 7. 8. [백준/파이썬] 27475번 Cancel the Trains -Codefor _ in range(int(input())): n, m = map(int, input().split()) counts = [0] * 101 train1 = list(map(int, input().split())) train2 = list(map(int, input().split())) res = 0 for el in train2: if el in train1: res += 1 print(res) 2024. 7. 7. [백준/파이썬] 26548번 Quadratics -Codefrom math import sqrtfor _ in range(int(input())): a, b, c = map(float, input().split()) res1 = (-b + sqrt(b ** 2 - 4 * a * c)) / (2 * a) res2 = (-b - sqrt(b ** 2 - 4 * a * c)) / (2 * a) print(f"{res1:.3f}, {res2:.3f}") 2024. 7. 6. 이전 1 ··· 34 35 36 37 38 39 40 ··· 366 다음