ABC153 - Atcoder/Python精進のための解説メモ
2022/07/20
ABC153 - A.Serval vs Monster
AtCoder公式 | ABC153 - A.Serval vs Monster解答
h, a = map(int, input().split())
print(h // a if h % a == 0 else h // a + 1)
要点解説メモ
- シンプルに書く
ABC153 - B.Common Raccoon vs Monster
AtCoder公式 | ABC153 - B.Common Raccoon vs Monster解答
h, n = map(int, input().split())
aaa = list(map(int, input().split()))
print('Yes' if sum(aaa) >= h else 'No')
要点解説メモ
- シンプルに書く
ABC153 - C.Fennec vs Monster
AtCoder公式 | ABC153 - C.Fennec vs Monster解答
n, k = map(int, input().split())
hhh = list(map(int, input().split()))
hhh.sort()
print(sum(hhh) if k == 0 else sum(hhh[:-k]))
要点解説メモ
- 必殺技を使える回数分、体力が大きいやつを倒すのが最適
ABC153 - D.
AtCoder公式 | ABC153 - D.解答
まだ解いていません