파이썬2187 [백준/파이썬] 29965번 Average scores -Codefrom sys import stdininput = stdin.readlinen = int(input())m_total, j_total = 0, 0m_cnt, j_cnt = 0, 0m_res, j_res = 0, 0for _ in range(n): a, b = input().split() b = int(b) if a == "M": m_total += b m_cnt += 1 else: j_total += b j_cnt += 1if m_cnt != 0: m_res = m_total / m_cntif j_cnt != 0: j_res = j_total / j_cntif m_res j_res: print('M')el.. 2024. 11. 10. [백준/파이썬] 32529번 래환이의 여자친구 사귀기 대작전 -Coden, m = map(int, input().split())days = list(map(int, input().split()))if sum(days) sum(days[i:n]): print(i) break 2024. 11. 9. [백준/파이썬] 24303번 ПРЪЧКИ -Codeline = list(map(int, input().split()))rods = sorted([[line[i], line[i + 3]] for i in range(3)], key=lambda x: x[0], reverse=True)l, total, res = line[6], 0, 0while l > total and rods[0][1] + rods[1][1] + rods[2][1] > 0: for i in range(3): if rods[i][1] > 0: total += rods[i][0] rods[i][1] -= 1 res += 1 breakprint(res if total.. 2024. 11. 8. [백준/파이썬] 28640번 Домино -Codedomino1 = list(input().split("|"))domino2 = list(input().split("|"))for domino in domino1: if domino in domino2: print("Yes") exit()print("No") 2024. 11. 7. [백준/파이썬] 32401번 ANA는 회문이야 -Coden = int(input())s = input()n_cnt, res = 0, 0for i in range(n): if s[i] == "A": for j in range(i + 1, n): if s[j] == "A": if n_cnt == 1: res += 1 break elif s[j] == "N": n_cnt += 1 n_cnt = 0print(res) 2024. 11. 6. [백준/파이썬] 26594번 ZOAC 5 -Codes = input()print(s.count(s[0])) 2024. 11. 5. 이전 1 ··· 13 14 15 16 17 18 19 ··· 365 다음