ABC180 - Atcoder/Python精進のための解説メモ
2022/12/27
ABC180 - A.box
AtCoder公式 | ABC180 - A.box解答
n, a, b = map(int, input().split())
print(n - a + b)
要点解説メモ
- やるだけ
ABC180 - B.Various distances
AtCoder公式 | ABC180 - B.Various distances解答
n = int(input())
xxx = list(map(lambda x: abs(int(x)), input().split()))
print(sum(xxx))
print(sum(x ** 2 for x in xxx) ** 0.5)
print(max(xxx))
要点解説メモ
- xは先に絶対値処理しておいたほうがはやそう
ABC180 - C.Cream puff
AtCoder公式 | ABC180 - C.Cream puff解答
def make_divisors(n):
lower_divisors, upper_divisors = [], []
i = 1
while i * i <= n:
if n % i == 0:
lower_divisors.append(i)
if i != n // i:
upper_divisors.append(n // i)
i += 1
return lower_divisors + upper_divisors[::-1]
n = int(input())
print(*make_divisors(n), sep='
')
要点解説メモ
- 約数列挙の問題
- たまに出るので約数列挙のコードを手元で用意しておきたい
ABC180 - D.
AtCoder公式 | ABC180 - D.解答
まだ解いていません