2020-06-01から1ヶ月間の記事一覧

ABC082 をPythonで解く

atcoder.jp A~Cを解いた。 A - Round Up the Mean import numpy as np A,B = map(int,input().split()) ans = int(np.ceil((A+B)/2)) print(ans) B - Two Anagrams s = input() t = input() sl = list(s) sl.sort() tl = list(t) tl.sort() tl=tl[::-1] S=""…

ABC166 をPythonで解く

atcoder.jp A~Dを解いた。 A - A?C S = input() if S=="ABC": print("ARC") else: print("ABC") B - Trick or Treat N,K = map(int,input().split()) O = [0]*N for k in range(K): d = int(input()) A = [int(i) for i in input().split()] for a in A: O[a…

ABC151 をPythonで解く

atcoder.jp A~Cを解いた。 A C =input() ans = ord(C) ans = chr(ans+1) print(ans) B N,K,M = map(int,input().split()) A = [int(i) for i in input().split()] ans = N*M - sum(A) if ans >K: print(-1) exit() print(max(ans,0)) C N,M = map(int,input(…

ABC114 をPythonで解く

atcoder.jp A~Cを解いた。 A X =int(input()) if X in [7,5,3]: ans ="YES" else: ans ="NO" print(ans) B m=min(m,xxx)でコード量削減 S =input() m = 753 for i in range(len(S)-2): tmp=(S[i:i+3]) m=min(abs(753-int(tmp)),m) print(m) C さすがに今日は…

ABC066 をPythonで解く

atcoder.jp A~Cを解いた。 A A = [int(a) for a in input().split()] ans = sum(A)-max(A) print(ans) B いままではif文で処理していた最大値部分をm = max(m,xxx))と書いている人がいたので真似してみた。当たり前と言われればそれまでだがスマートな書き方…

ABC067 をPythonで解く

atcoder.jp A~Cを解いた。 A A,B =map(int,input().split()) if A%3==0 or B%3==0 or (A+B)%3==0: ans = "Possible" else: ans ="Impossible" print(ans) B N,K = map(int,input().split()) L =[int(i) for i in input().split()] L.sort(reverse=True) ans …

ABC166 をPythonで解く

atcoder.jp A~Cを解いた。 A S = input() if S=="ABC": print("ARC") else: print("ABC") B N,K = map(int,input().split()) O = [0]*N for k in range(K): d = int(input()) A = [int(i) for i in input().split()] for a in A: O[a-1]+=1 print(O.count(0)…

2020年5月振り返り

AtCoder 精進 5月はGWからAtCoderを再開して、110問くらい解いた。 コンテスト ABC168と169に出場。168でレート上がったけど169で戻った。 レートが590で茶色の真ん中くらいなんですけど、 400点問題が解けるようにならないとレートが上がることを期待できな…