2024/04/155 백준 31606 果物 (Fruit) https://www.acmicpc.net/problem/31606 31606번: 果物 (Fruit) リンゴが X 個,ミカンが Y 個,バナナが 3 個ある.リンゴとミカンとバナナが合わせて何個あるかを求めよ. www.acmicpc.net 1234567891011def sol(x, y): return x + y + 3 if __name__ == '__main__': x = int(input()) y = int(input()) print(sol(x, y)) cs 2024. 4. 15. 백준 31610 飴の袋詰め (Drops Packing) https://www.acmicpc.net/problem/31610 31610번: 飴の袋詰め (Drops Packing) 1 個 A 円の飴を B 個と,C 円の袋を 1 つ買う.合計金額はいくらか求めよ. www.acmicpc.net 1234567891011def sol(a, b, c): return a * b + c if __name__ == '__main__': a = int(input()) b = int(input()) c = int(input()) print(sol(a, b, c)) cs 2024. 4. 15. 백준 31611 火曜日 (Tuesday) https://www.acmicpc.net/problem/31611 31611번: 火曜日 (Tuesday) 今日の X 日後が火曜日であるならば 1 を,そうでないならば 0 を出力せよ. 答え以外は何も出力しないこと.(入力を促す文章なども出力しないこと.) www.acmicpc.net 1234567891011def sol(x): if x % 7 == 2: return 1 else: return 0 if __name__ == '__main__': x = int(input()) print(sol(x)) cs 2024. 4. 15. 백준 31614 分 (Minutes) https://www.acmicpc.net/problem/31614 31614번: 分 (Minutes) 整数 H, M が与えられる. H 時間 M 分が何分かを求めよ. www.acmicpc.net 123456789def sol(h, m): return h * 60 + m if __name__ == '__main__': h = int(input()) m = int(input()) print(sol(h, m)) cs 2024. 4. 15. 백준 31654 Adding Trouble https://www.acmicpc.net/problem/31654 31654번: Adding Trouble Your friend Bob is really bad at adding numbers, and he’d like some help to make sure he’s doing it correctly! Can you help Bob make sure he is adding correctly? Given 3 integers $A$, $B$, $C$, make sure that $A + B = C$, and that Bob indeed added $A$ www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 def sol(a, b, c): if a + b == c: return "corr.. 2024. 4. 15. 이전 1 다음