AtCoder Beginner Contest 064
はい。
https://atcoder.jp/contests/abc064
A - RGB Cards
Python3
r,g,b=map(str,input().split()) print('NO' if int(r+g+b)%4 else 'YES')
3桁の数にして剰余を確認。言語によって文字列で結合してintにしたり。数を1桁ずつ受け取ってから *100とか *10したりするやり方もあるかもしれない。
B - Traveling AtCoDeer Problem
Python3
input() l=[int(i) for i in input().split()] print(max(l)-min(l))
好きな位置開始の好きな位置終わりなので最大値と最小値の差が解に。
C - Colorful Leaderboard
n=int(input()) l=[int(i) for i in input().split()] cnt=[0]*9 ans=0 for i in l: if i>3199: i=3200 cnt[i//400]+=1 for p in range(8): i=cnt[p] if i!=0: ans+=1 print(ans if ans!=0 else 1,ans+cnt[-1])
3200は好きに選べるのでその人数分だけ色が増える場合あり。好きに選べるので既存の色を選んで増えない場合あり。それを計算すれば多分大丈夫だと思う。
D - Insertion
Python3
n=int(input()) s=input() d=[0,0] for i in s: if i=="(": d[0]+=1 if i==")" and d[0]>0: d[0]-=1 for i in s[::-1]: if i==")": d[1]+=1 if i=="(" and d[1]>0: d[1]-=1 s="("*d[1]+s+")"*d[0] print(s)
足りない"("は全部左端に、足りない")"は全部右端に寄せる。辞書順のために。