problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03206
s301677575
Accepted
D = int(input()) #かわむら today = "Christmas" x = 25 - D today += x * " Eve" print(today)
p03274
s068057547
Wrong Answer
N,K = map(int,input().split()) X = list(map(int,input().split())) ls = [] rs = [] for x in X: if x < 0: ls.append(-x) else: rs.append(x) ls.reverse() ans = float('inf') if len(ls) >= K: ans = min(ans, ls[K-1]) if len(rs) >= K: ans = min(ans, rs[K-1]) for l in range(1,K): r = K-l if l >= len(ls) or r >= len(rs): break ans = min(ans, ls[l-1]*2 + rs[r-1]) ans = min(ans, rs[r-1]*2 + ls[l-1]) print(ans)
p02909
s221314307
Wrong Answer
T={'Sunny':'Cloudy','Cloudy':'Rainy','Rainy':'Sunny'} print(T['Sunny'])
p03077
s816122087
Accepted
# 初期入力 import sys import math input = sys.stdin.readline N = int(input()) a_max =[] #移動手段の最大乗車人数 num =[0]*5 #各移動機関の稼働回数 for i in range(5): x = int(input()) a_max.append(x) num[i] =math.ceil(N /x) #ボトルネックを過ぎれば、時間は距離に比例 max_value = max(num) max_index = num.index(max_value) ans =num[max_index] +6-2 print(ans)
p03161
s649791217
Accepted
import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 def input(): return sys.stdin.readline().rstrip() def main(): N,K=map(int,input().split()) h=list(map(int,input().split()))+[INF]*K dp=[INF]*(2*10**5) dp[0]=0 for i in range(N): for k in range(1,K+1): dp[i+k]=min(dp[i+k],dp[i]+abs(h[i+k]-h[i])) print(dp[N-1]) if __name__ == '__main__': main()
p02570
s419557714
Accepted
d,t,s = map(int,input().split()) print('Yes' if s*t>=d else 'No')
p02900
s233830880
Wrong Answer
from fractions import gcd A, B = map(int, input().split()) saidai_kouyaku = gcd(A,B) kouyaku = [0 for _ in range(int(saidai_kouyaku**0.5)+1)] kouyaku[1] = 1 for i in range(2,len(kouyaku)): while saidai_kouyaku%i==0: kouyaku[i]+=1 saidai_kouyaku = saidai_kouyaku/i answer = 0 for i in range(len(kouyaku)): if kouyaku[i] > 0: answer += 1 if answer >= 2: print(answer) else: print(2)
p02860
s733345838
Accepted
n = int(input()) S = input() s = list(S) p = 1 if n % 2 == 0: for i in range(n//2): if s[i] == s[i + n//2]: continue else: p = 0 else: p = 0 if p == 1: print('Yes') else: print('No')
p03067
s187867975
Accepted
a,b,c=map(int,input().split()) print("Yes"if a<=c<=b or b<=c<=a else "No")
p02786
s253249689
Wrong Answer
import math k=int(input()) ans=0 if k==1: print('1') i=0 while True: k=math.floor(k/2) ans+=2**i i+=1 if k<1: print(ans) exit()
p02787
s810276049
Wrong Answer
h,n=map(int,input().split()) ans=0 magic=[] al=[] bl=[] for i in range(n): a,b=map(int,input().split()) magic.append([a,b]) al.append(a) bl.append(b) amx=max(al) bmn=min(bl) dp=[-1]*(h+amx+1) dp[0]=0 for i in range(1,h+amx+1): mn=9999999 for j in magic: mp=j[1] at=j[0] if at>i: continue cst=dp[i-at]+mp if cst<mn: mn=cst if mn==9999999: mn=bmn dp[i]=mn print(min(dp[h:]))
p03435
s890691359
Accepted
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product # import math import numpy as np import sys sys.setrecursionlimit(10 ** 5 + 10) # input = sys.stdin.readline def resolve(): G=np.array([list(map(int,input().split())) for _ in range(3)]) G[1]-=G[0] G[2]-=G[0] if len(set(G[1]))==1 and len(set(G[2]))==1: print('Yes') else: print('No') resolve()
p03107
s272705331
Accepted
from collections import Counter S = input() l = list() for i in S: l.append(i) c = Counter(l) print(min(c['0'], c['1'])*2)
p02970
s103015994
Accepted
N,D=map(int,input().split()) print((2*D+N)//(2*D+1))
p02959
s696471453
Accepted
n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = 0 for i in range(n): a_m = min(a[i], b[i]) c += a_m b[i] -= a_m b_m = min(a[i+1], b[i]) a[i+1] -= b_m c += b_m print(c)
p02687
s811338297
Accepted
s=input() if s=="ABC": print("ARC") else: print("ABC")
p03359
s457034051
Accepted
a, b = map(int, input().split()) if a > b: print(a-1) else: print(a)
p02677
s231241166
Wrong Answer
import math a,b,h,m=map(int, input().split()) h_rad = 30*h m_rad = 0.5*m diff1 = abs(h_rad-m_rad) diff2 = 360-diff1 diff = min(diff1,diff2) cos = math.cos(math.radians(diff)) ans = math.sqrt(a**2+b**2-(2*a*b*cos)) print(ans)
p03495
s587120917
Accepted
N,K=map(int, input().split()) A=list(map(int, input().split())) A.sort() cnt=0 l=[] l.append([A[0],0]) for i in range(len(A)): if A[i]==l[cnt][0]: l[cnt][1]+=1 else: cnt+=1 l.append([A[i],1]) if len(l) <= K: print(0) else: l.sort(key=lambda x: x[1]) sum=0 for i in range(len(l)-K): sum+=l[i][1] print(sum)
p04012
s347186543
Wrong Answer
#abc044 b s=input() moji=dict() flag=True for i in range(len(s)): if i not in moji: moji[i]=1 else: moji[i]+=1 for i in moji.values(): if i%2==1: flag=False break print("Yes" if flag else "No")
p02664
s215045416
Accepted
T = list(input()) ans = 0 i = 0 while i < len(T): if T[i] == "?": T[i] = "D" i += 1 print("".join(T))
p03543
s914162206
Wrong Answer
N=input() list=[a for a in N] if list.count(list[0])==3 or list.count(list[1])==3 or list.count(list[2])==3 or list.count(list[3])==3: print('Yes') else: print('No')
p02829
s156272902
Wrong Answer
a = int(input()) b = int(input()) if a==1 and b==2:print(3) elif a==2 and b == 3:print(1) elif a==3 and b == 1:print(2)
p02693
s633814537
Accepted
def main(): k = int(input()) #s = input() #s = input().split() a,b = list(map(int,input().split())) #a = [input() for i in range(n)] #a = [int(input()) for i in range(n)] #a = [input().split() for i in range(n)] #a = [list(map(int,input().split())) for i in range(n)] ans = 0 count = 0 lis = [] for i in range(a,b+1): if i % k == 0: print("OK") exit() print("NG") if __name__ == '__main__': main()
p02784
s597292389
Wrong Answer
h,n=map(int,input().split()) s = sum(list(map(int,input().split()))) print("Yes" if s>=h else print("No"))
p02606
s688287642
Accepted
L, R, d = [int(i) for i in input().split()] cnt = 0 for i in range(L, R+1): if i % d == 0: cnt += 1 print(cnt)
p02633
s248462959
Accepted
x = int(input()) j = 0 for i in range(360): j += x j %= 360 if j == 0: print(i+1) exit()
p03605
s519382564
Accepted
print("Yes" if "9" in input() else "No")
p03073
s711711705
Accepted
S = input() b = 1 B = 0 l = 0 for i in S: if int(i) != b: B += 1 b = 1 - b l += 1 print(min(B, l - B))
p03548
s660997927
Accepted
X,Y,Z = map(int,input().split()) print((X-Z)//(Y+Z))
p03448
s118147111
Wrong Answer
a = int(input()) b = int(input()) c = int(input()) x = int(input()) ans = 0 for i in range(1,a+1): for j in range(1,b+1): for k in range(1,c+1): if i*500+j*100+k*50==x: ans+=1 print(ans)
p03163
s450149575
Accepted
n,w=map(int,input().split()) weight=[] value=[] for i in range(n): a,b=map(int,input().split()) weight+=[a] value+=[b] dp=[[0]*(w+1) for i in range(n+1)] for i in range(n): for j in range(w+1): if j<weight[i]: dp[i+1][j]=dp[i][j] else: dp[i+1][j]=max(dp[i][j],dp[i][j-weight[i]]+value[i]) print(dp[n][w])
p02983
s009799177
Wrong Answer
l, r = map(int, input().split()) i = l j = i + 1 count = 0 arr = [] while(True): if count == 10000 or j == r: break else: arr.append((i*j) % 2019) j += 1 count += 1 if len(arr) == 0: arr.append((l*r) % 2019) print(min(arr))
p02820
s491121031
Accepted
n, k = map(int, input().split()) r, s, p = map(int, input().split()) t = input() tt = list(t) d = {'r':p, 's': r, 'p':s} dp = [d[t[i]] for i in range(n)] for i in range(n-k): if tt[i]==tt[i+k]: dp[i+k] = 0 tt[i+k] = 'x' print(sum(dp))
p03617
s537974384
Wrong Answer
l = [[0.25],[0.5],[1],[2]] tmp = list(map(int,input().split())) for i in range(4): l[i].append(tmp[i]) for i in range(4): l[i].append(l[i][1]*4//l[i][0]) from operator import itemgetter l = sorted(l, key=itemgetter(2)) ans = 0 n = int(input()) for i in range(4): tmp = n//l[i][0] if tmp > 0: ans += tmp * l[i][1] n -= tmp*l[i][0] print(int(ans))
p03385
s929281895
Wrong Answer
S = input() if "a" and "b" and "c" in S: print( "Yes" ) else: print( "No" )
p02796
s126831922
Accepted
N = int(input()) arms = [] for i in range(0, N): X, L = map(int, input().split(" ")) arms.append((X + L, X - L)) arms.sort() ans = 0 coord = -float('inf') for arm in arms: if arm[1] >= coord: ans += 1 coord = arm[0] print(ans)
p03760
s218524565
Wrong Answer
o=input() e=input() t="" for i in range(len(e)): t+=o[i] t+=e[i] print(t)
p03493
s702133003
Accepted
S=input() print(S.count('1'))
p03077
s484526323
Accepted
import math n = int(input()) abcde = [int(input()) for _ in range(5)] print(4 + math.ceil(n / min(abcde)))
p03644
s448661638
Wrong Answer
n = input() print("ABC"+n)
p02989
s721451315
Accepted
N = int(input()) d = list(map(int, input().split())) d.sort() print (d[N//2]-d[N//2-1])
p03665
s899989579
Accepted
n, p = map(int, input().split()) A = list(map(int, input().split())) if all(a % 2 == 0 for a in A): print(0 if p == 1 else 2**n) else: print(2**(n - 1))
p02989
s885088654
Accepted
N= int(input()) d=list(map(int,input().split())) d.sort() ans=d[N//2]-d[N//2-1] print(ans)
p02570
s361619588
Wrong Answer
d,t,s=list(map(int,input().split())) if d/t<=s: print("yes") else: print("No")
p02689
s457763035
Wrong Answer
N,M = map(int,input().split()) H = list(map(int,input().split())) datas = [] anss = [] for i in range(M): datas.append(list(map(int,input().split()))) for data in datas: ans = [] for dat in data: ans.append(H[dat-1]) anss.append(max(ans)) print(len(set(anss)))
p03699
s067517736
Accepted
N = int(input()) s = sorted([int(input()) for _ in range(N)]) all_10 = True for i in range(N): if s[i] % 10 != 0: all_10 = False if all_10: print(0) exit() sum_s = sum(s) if sum_s % 10 != 0: print(sum_s) else: for i in range(N): if s[i] % 10 != 0: print(sum_s - s[i]) break
p02797
s599101727
Accepted
N, K, S = map(int, input().split()) l = [] for i in range(K): l.append(str(S)) for i in range(N-K): if S == 1: l.append(str(S+1)) else: l.append(str(S-1)) print(' '.join(l))
p02694
s481384795
Wrong Answer
import math x = int(input()) orig = 100 counter = 0 while orig <= x: orig = math.floor(orig * 1.01) counter += 1 print(counter)
p03448
s121333895
Accepted
import collections import sys import numpy as np sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop MOD = 10**9+7 import itertools import math a = int(input()) b = int(input()) c = int(input()) x = int(input()) cnt = 0 for i in range(a+1): for j in range(b+1): for k in range(c+1): if x == i*500 + j*100 + 50*k: cnt+=1 print(cnt)
p02684
s134478753
Wrong Answer
N, K = list(map(int, input().split())) A = list(map(int, input().split())) #loop check gone = [] pos = 0 i = 0 while pos not in gone: gone.append(pos) pos = A[pos] - 1 i += 1 if (pos in gone): loop_flag = True loop_pos = gone.index(pos) loop_len = len(gone)-loop_pos if (loop_flag): pos = loop_pos for i in range(((K - loop_pos) % loop_len)-1): pos = A[pos]-1 else: pos = 0 for i in range(K): pos = A[pos]-1 print(pos+1)
p03106
s660967340
Accepted
def main(): from builtins import int, map, list, print import sys sys.setrecursionlimit(10 ** 6) input = sys.stdin.readline input_list = (lambda: input().rstrip().split()) input_number = (lambda: int(input())) input_number_list = (lambda: list(map(int, input_list()))) A, B, K = input_number_list() t = 0 i = max(A,B)+1 while t < K: i -= 1 t += 1 if A % i == 0 and B % i == 0 else 0 print(i) main()
p03835
s235499566
Wrong Answer
# coding: utf-8 x=input().split(" ") k=int(x[0]) s=int(x[1]) sum=0 for i in range(k+1): if s-i<=k*2 and s-i>=k: sum+=k*2-s+i+1 elif s-i<k: sum+=s-i+1 print(sum)
p02726
s987575906
Accepted
import sys from collections import deque read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): N, X, Y = map(int, readline().split()) X -= 1 Y -= 1 ans = [0] * N for i in range(N - 1): for j in range(i + 1, N): d = min(j - i, abs(i - X) + 1 + abs(Y - j)) ans[d] += 1 print('\n'.join(map(str, ans[1:]))) return if __name__ == '__main__': main()
p03211
s201505752
Wrong Answer
s = input() min_ = 10**18 for i in range(len(s)-3): min_ = min(min_, abs(753 - int(s[i:i+3])))
p03243
s603762102
Accepted
s = input() n = int(s) m = [] y = n while y > 0: z = y % 10 m.append(z) y = int(y / 10) p = m[len(m) - 1] max_num = 0 for i in range(len(m)): max_num = max(max_num, m[i]) if p < max_num: p += 1 for i in range(len(m)): m[i] = p print(m[i], end='') print('')
p02630
s451770482
Accepted
import numpy as np from collections import defaultdict s = list(map(int, input().split())) n=s[0] a = np.array(list(map(int, input().split()))) s = list(map(int, input().split())) q=s[0] num=defaultdict(int) ans=0 for i in a: num[i]+=1 ans+=i for i in range(q): s = list(map(int, input().split())) a=s[0] b=s[1] ans=ans-a*num[a]-b*num[b] num[b]=num[a]+num[b] ans = ans+b*num[b] num[a]=0 print(ans)
p02973
s268052045
Wrong Answer
n = int(input()) A = [] for _ in range(n): a = int(input()) A.append(a) ans = 0 tmp = 1 if n==1:print(1);exit() for i in range(n-1): if A[i]>=A[i+1]: tmp += 1 else: tmp = 1 ans = max(ans,tmp) print(ans)
p03254
s410335490
Accepted
N, x = map(int,input().split()) a = list(map(int,input().split())) count = 0 a_new = sorted(a) for i in range(0, N): count += a_new[i] if x == count: index = i + 1 break if count > x: index = i break index = i print(str(index))
p03994
s237146088
Accepted
s = list(input()) n = len(s) k = int(input()) t = [ord(s[i]) - 97 for i in range(n)] for i in range(n): if k == 0: break x = 26 - t[i] if 0 < x % 26 <= k: k -= x s[i] = "a" t[-1] = ord(s[-1]) - 97 if k > 0: s[-1] = chr((k + t[-1]) % 26 + 97) print("".join(s))
p03854
s243893184
Wrong Answer
s = input() d = { "eam":5, "mer":7, "ase":5, "ser":6} index = len(s) while index != 0: tmp = s[index-3:index] if tmp not in d.keys(): break index -= d[tmp] if index < 0: break else: print("YES") exit() print("NO")
p03309
s236738192
Accepted
n = int(input()) A = list(map(int, input().split())) B = [a-i-1 for i, a in enumerate(A)] med = sorted(B)[n//2] print(sum(abs(a-med) for a in B))
p03243
s048012897
Wrong Answer
n=input() l=len(n) k=0 for i in range(l): for j in range(i,l): if n[i]!=n[j]: k=1 if k==1: print(n[0]*l) else: print(n)
p03371
s951991728
Wrong Answer
A,B,C,X,Y=map(int,input().split()) price=0 if A+B>C+C: minXY=min(X,Y) price+=minXY*C*2 X-=minXY Y-=minXY if A>C+C: price=X*2*C X=0 else: price+=A*X X=0 if B>C+C: price=Y*2*C Y=0 else: price+=B*Y Y=0 print(price)
p03419
s916845657
Accepted
N, M = map(int, input().split()) if N == 1 and M == 1: print(1) elif N == 1 or M == 1: print(max(N, M) - 2) else: print((N - 2) * (M - 2))
p02548
s874263007
Accepted
N = int(input()) ans = 0 for i in range(1, N+1): ans += (N-1) // i print(ans)
p02917
s798050771
Accepted
N = int(input()) X = list(map(int, input().split())) ans = X[0] + X[-1] for i in range(N - 2): ans += min(X[i], X[i + 1]) print(ans)
p04043
s165682701
Accepted
from fractions import gcd from collections import Counter, deque, defaultdict from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort from itertools import accumulate, product, permutations, combinations def main(): A = list(map(int, input().split())) print('YES') if A.count(5) == 2 and A.count(7) == 1 else print('NO') if __name__ == '__main__': main()
p03419
s250906838
Accepted
n, m = map(int, input().split()) if n > m: t = n n = m m = t w = 0 if m == n == 1: print(1) exit() if n == 1 and m != 1: print(m-2) elif n != 1: print((n-2)*(m-2))
p03095
s186255489
Wrong Answer
from collections import Counter n = int(input()) S = input() n = Counter(S) ans = 1 for i, j in n.items(): ans *= (j+1) print(ans-1)
p03262
s201907831
Accepted
from fractions import gcd from functools import reduce def Skip(n , x , xl): xl = map(lambda i: abs(i - x), xl) return reduce(gcd , xl) def main(): n , x = map(int , input().split()) xl = list(map(int , input().split())) print(Skip(n , x , xl)) if __name__ == '__main__': main()
p02756
s479938033
Accepted
from collections import deque s=deque(input()) q=int(input()) cnt=0 for i in range(q): query=list(input().split()) if query[0]=="1": cnt+=1 else: if (cnt+int(query[1]))%2==1: s.appendleft(query[2]) else: s.append(query[2]) if cnt%2==1: s=reversed(s) print("".join(s))
p03103
s224017639
Wrong Answer
import sys input = sys.stdin.readline n,m = map(int,input().split()) l = [] for i in range(n): a,b = map(int,input().split()) l.append([a,b]) i = 0 count = 0 money = 0 while count < m: count += l[i][1] money = l[i][0]*l[i][1] i += 1 i -= 1 if count > m: money - (m-count)*l[i][1] print(money)
p03639
s703557150
Accepted
N = int(input()) a = list(map(int, input().split())) A = [] B = [] C = [] for i in range(N): if a[i]%4 == 0: A.append(a[i]) elif a[i]%2 == 0: B.append(a[i]) else: C.append(a[i]) if len(B) == 0 and len(A)+1 >= len(C): print('Yes') elif len(A) >= len(C): print('Yes') else: print('No')
p02711
s246330029
Wrong Answer
N = input() for i in N: if i == '7': print('Yes') else: print('No')
p02615
s013485723
Accepted
n = int(input()) a = list(map(int, input().split())) a.sort(reverse=True) ans = a[0] + 2 * sum(a[1:n // 2]) if n % 2: ans += a[n // 2] print(ans)
p03338
s096071204
Accepted
n=int(input()) moji=str(input()) cnt=0 for i in range(n): count = 0 temp=moji[:i+1] lst=[] for j in range(i+1): if temp[j] in moji[i+1:] and temp[j] not in lst: count+=1 lst.append(temp[j]) if count > cnt: cnt=count print(cnt)
p02771
s017188012
Accepted
a, b, c = map(int, input().split()) if (a == b and a != c) or (a ==c and a != b) or (b == c and b != a): print("Yes") else: print("No")
p03644
s214198945
Accepted
n = int(input()) count = 0 for i in range(n+1): new = 0 while i % 2 == 0 and i != 0: new += 1 i /= 2 if new > count: count = new print(2**count)
p02771
s945035354
Accepted
a = list(map(int,input().split())) a.sort() if a[0] == a[1]: if a[1] == a[2]: print("No") else: print("Yes") else: if a[1] == a[2]: print("Yes") else: print("No")
p02729
s578309556
Wrong Answer
n,m = map(int,input().split()) if n <= 1: n = 0 else: n = n * (n-1) / 2 if m <= 1: m = 0 else: m = m * (m-1) / 2 print(n+m)
p03073
s452061403
Accepted
s = input() count = 0 for i in range(len(s)): if i % 2 == 0: if s[i] == '0': count += 1 else: if s[i] == '1': count += 1 print(min(len(s)-count, count))
p02860
s851951421
Wrong Answer
n = int(input()) s = input() if n % 2 == 1: print('No') exit() for i in range(n // 2): if s[i] != s[n // 2 - 1 + i]: print('No') exit() print('Yes')
p02958
s096158429
Accepted
n = int(input()) p = list(map(int, input().split())) a = sorted(p) b = 0 for i in range(n): if p[i] != a[i]: b += 1 if b == 2 or b == 0: print('YES') else: print('NO')
p03804
s696212986
Accepted
import numpy as np N, M = map(int, input().split()) A = np.array([list(input()) for i in range(N)]) B = np.array([list(input()) for i in range(M)]) for i in range(N-M+1): for j in range(N-M+1): if (A[i:i+M,j:j+M] == B).all(): print('Yes') quit() print('No')
p02659
s212182749
Wrong Answer
a, b = map(float, input().split()) print(int(a*b))
p02676
s856398730
Accepted
k = int(input()) s = str(input()) if k < len(s): print(s[:k] + "...") else: print(s[:k])
p03971
s478697447
Wrong Answer
N,A,B = map(int,input().split()) S = input() pass_num = 0 for i in S: if i == 'a': if (A + B)-1 >= pass_num: print('Yes') pass_num += 1 else: print('No') elif i == 'b': if B-1 >= pass_num: print('Yes') pass_num += 1 else: print('No') else:# i == 'c' print('No')
p02608
s243100921
Wrong Answer
t = int(input()) for i in range(t): if i < 6: print(0) else: tmp = i - 3 num = 0 for x in range(tmp): x += 1 for y in range(tmp-x): y += 1 for z in range(tmp-x-y): z += 1 if i == x**2 + y**2 + z**2 + x*y + x*z + y*z: num += 1 print(num)
p04012
s530315175
Accepted
#abc044 b s=input() moji=dict() flag=True for i in s: if i not in moji: moji[i]=1 else: moji[i]+=1 for i in moji.values(): if i%2==1: flag=False break print("Yes" if flag else "No")
p02641
s015318140
Accepted
import sys sys.setrecursionlimit(10000000) MOD = 10 ** 9 + 7 INF = 10 ** 15 def main(): X,N = map(int,input().split()) P = set(map(int,input().split())) ans = -1 M = INF for i in range(X - 105,X + 105): if i not in P: if M > abs(i - X): ans = i M = abs(i - X) print(ans) if __name__ == '__main__': main()
p02639
s923237458
Accepted
a,b,c,d,e = map(int,input().split()) x = [a,b,c,d,e] for i in range(len(x)): if x[i] == 0: print(i+1)
p03693
s409194191
Wrong Answer
# -*- coding: utf-8 -*- r, g, b = map(int, input().split()) n = r*100 + g*10 + b print("{}".format(n)) if n % 4 == 0: print("YES") else: print("NO")
p02951
s101708421
Wrong Answer
A,B,C = map(int,input().split()) print(C-(A-B))
p03524
s424230907
Accepted
from collections import Counter c = Counter(input()) labels = ['a', 'b', 'c'] min_cnt = min(c[label] for label in labels) cnt = [c[label] - min_cnt for label in labels] for x in cnt: if x in (0, 1): continue print('NO') break else: print('YES')
p02958
s811552633
Wrong Answer
n = int(input()) p = list(map(int, input().split())) cnt = 0 for i in range(0, n-1): x = abs(p[i]-p[i+1]) if x != 1: cnt += 1 if cnt < 3: print("YES") else: print("NO")
p02817
s437177232
Accepted
s, t = input().split() print(t + s)
p03474
s919776464
Accepted
a,b=map(int,input().split()) s=input() print('Yes' if len(s)==a+b+1 and all(s[i] in '0123456789' if i!=a else s[i]=='-' for i in range(len(s))) else 'No')
p02916
s136972329
Accepted
n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = list(map(int, input().split())) total = 0 total += sum(b) for i in range(n-1): if a[i] + 1 == a[i+1]: total += c[a[i]-1] print(total)
p03250
s140411324
Wrong Answer
A, B, C = input().split() print(max(int(A+B) + int(C), int(B+C) + int(A), int(A+C) + int(B)))