前回の振り返り
今日はABC406開催日だったので参加結果を振り返る
今週はA,Bの2完(1ペナ)
A
2つめの条件にA==C
をつけ忘れて1ペナ
ソースコード
main.py
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, Counter, deque
from functools import reduce, lru_cache
from itertools import product, accumulate, groupby, combinations
import sys
import os
def rI(): return int(sys.stdin.readline().rstrip())
def rLI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def rI1(): return (int(sys.stdin.readline().rstrip())-1)
def rLI1(): return list(map(lambda a:int(a)-1,sys.stdin.readline().rstrip().split()))
def rS(): return sys.stdin.readline().rstrip()
def rLS(): return list(sys.stdin.readline().rstrip().split())
IS_LOCAL = int(os.getenv("ATCODER", "0"))==0
err = (lambda *args, **kwargs: print(*args, **kwargs, file=sys.stderr)) if IS_LOCAL else (lambda *args, **kwargs: None)
def main():
A, B, C, D = rLI()
ans = A > C or ((A == C)and(B > D))
print('Yes' if ans else 'No')
if __name__ == '__main__':
main()
B
10**K 以上かどうかで判断できるpythonの多倍長整数に感謝
ソースコード
main.py
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, Counter, deque
from functools import reduce, lru_cache
from itertools import product, accumulate, groupby, combinations
import sys
import os
def rI(): return int(sys.stdin.readline().rstrip())
def rLI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def rI1(): return (int(sys.stdin.readline().rstrip())-1)
def rLI1(): return list(map(lambda a:int(a)-1,sys.stdin.readline().rstrip().split()))
def rS(): return sys.stdin.readline().rstrip()
def rLS(): return list(sys.stdin.readline().rstrip().split())
IS_LOCAL = int(os.getenv("ATCODER", "0"))==0
err = (lambda *args, **kwargs: print(*args, **kwargs, file=sys.stderr)) if IS_LOCAL else (lambda *args, **kwargs: None)
def main():
N, K = rLI()
A = rLI()
M = 10 ** K
ans = A[0]
for a in A[1:]:
ans *= a
if ans >= M:
ans = 1
err(ans)
print(ans)
if __name__ == '__main__':
main()
C
差分と2階差分をだしたけど
どうやって数えるのって感じ。
D
X座標別にまとめるのとY座標別にまとめようとして
X座標で消したあとにY座標別のまとめにどう反映するかわからんかった。
E
コンビネーションからどう短縮するの?
bitDP?
F
貴様、木様の問題をだすのか!
G
有名なNP問題のオマージュですか…
感想
CとDが閃かなくてEも無理そうだったので逃亡しました。ごめんなさい