ABC185 - Atcoder/Python精進のための解説メモ
2022/12/27
ABC185 - A.ABC Preparation
AtCoder公式 | ABC185 - A.ABC Preparation解答
aaa = list(map(int, input().split()))
print(min(aaa))
要点解説メモ
- 開催には各点数別の問題が必要なので、それぞれの問題数のうち最小値が答え
ABC185 - B.Smartphone Addiction
AtCoder公式 | ABC185 - B.Smartphone Addiction解答
n, m, t = map(int, input().split())
cnt = 0
tmp_n = n
ans = 'Yes'
for _ in range(m):
a, b = map(int, input().split())
tmp_n -= a - cnt
if tmp_n <= 0:
ans = 'No'
break
cnt = a
tmp_n += b - cnt
tmp_n = n if tmp_n > n else tmp_n
cnt = b
ans = 'No' if tmp_n - t + cnt <= 0 else ans
print(ans)
要点解説メモ
- 丁寧にループ処理できるかを聞かれている問題な感じ
- 出力例をよく見て想像するのが大事そう
ABC185 - C.Duodecim Ferra
AtCoder公式 | ABC185 - C.Duodecim Ferra解答
def nCr(n, r):
c = 1
r = min(r, n - r)
for i in range(r):
c = c * (n - i) // (i + 1)
return c
l = int(input())
print(nCr(l - 1, 11))
要点解説メモ
- 11個の区切りを重複せず、どこに入れるか、というよくある問題
ABC185 - D.
AtCoder公式 | ABC185 - D.解答
まだ解いていません