problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02688
s665434469
Wrong Answer
n, k = [int(x) for x in input().split()] d = {} for _ in range(k): d.setdefault(input(), list(map(int, input().split()))) l = [] for _ in d.values(): l.extend(_) s = set(l) print(n - len(s))
p02796
s214908389
Accepted
N = int(input()) R = sorted([list(map(int, input().split())) for i in range(N)]) T = [] for i in range(N): T.append([R[i][0] + R[i][1], R[i][0] - R[i][1]]) T.sort(reverse=True) while len(T) - 1 > 0: t = T.pop() i = 1 while len(T) and t[0] > T[-1][1]: N -= 1 i += 1 T.pop() print(N)
p03795
s287628271
Accepted
n=int(input()) x=800*n y=200*(n//15) print(x-y)
p02988
s117320204
Wrong Answer
n = int(input()) p = list(map(int,input().split())) ans = [] for i in range(n-2): ans.append(sorted(p[i:i+3])[1]) print(len(set(ans)))
p03000
s329625637
Accepted
def cumsum(xs): result = [0,xs[0]] for x in xs[1:]: result.append(result[-1] + x) return result a,b=map(int,input().split()) c=list(map(int,input().split())) n=cumsum(c) ans=[] for i in range(len(n)): if n[i]<=b: ans.append(n[i]) print(len(ans))
p03000
s230253694
Accepted
N, val= list(map(int,input().split())) list = list(map(int,input().split())) d=0 l=[] for i in list: d=d+i l.append(d) count=0 for num in l: if num<=val: count=count+1 print(count+1)
p03997
s343899755
Wrong Answer
A = int(input()) B = int(input()) C = int(input()) print((A+B)*C/2)
p02608
s039715868
Wrong Answer
n = int(input()) ans = [0] * n loop = int((n/6) ** 1.5) + 1 def f(i, j, k): return i ** 2 + j ** 2 + k ** 2 + i*j + j*k + k*i for i in range(1, loop+1): for j in range(1, loop+1): for k in range(1, loop+1): res = int(f(i, j, k)) if res <= n: ans[res] += 1 for a in ans: print(a)
p02753
s761492284
Accepted
if __name__ == '__main__': s = input() print("No" if s == "AAA" or s == "BBB" else "Yes")
p03061
s342205277
Accepted
import fractions from functools import reduce n = int(input()) a = list(map(int,input().split())) #累積GCD left = [0] * (n + 1) right = [0] * (n + 1) for i in range(n): left[i + 1] = (fractions.gcd(left[i],a[i])) right[n - i - 1] = (fractions.gcd(right[n - i],a[n - 1 - i])) ans = 0 for i in range(n): ans = max(ans,fractions.gcd(left[i],right[i + 1])) print(ans)
p03136
s499419269
Wrong Answer
n=int(input()) l=map(int,input().split()) print('Yes' if max(l)*2< sum(l) else 'No')
p02555
s988883046
Accepted
N = int(input()) MOD = 10 ** 9 + 7 dp = [0] * 2010 dp[0] = 1 for i in range(3, N + 1): for j in range(i - 3 + 1): dp[i] = (dp[i] + dp[j]) % MOD print(dp[N])
p03013
s324408924
Accepted
N, M = map(int, input().split()) A = set(int(input()) for i in range(M)) MOD = 10 ** 9 + 7 DP = [0] * (N + 10) if 1 not in A: DP[1] = 1 if 2 not in A and 1 in A: DP[2] = 1 if 2 not in A and 1 not in A: DP[2] = 2 for i in range(3, N + 1): if i not in A: DP[i] = (DP[i - 1] + DP[i - 2]) % MOD print(DP[N])
p02639
s887289119
Accepted
x=list(map(int,input().split())) print(x.index(0)+1)
p02795
s844941592
Wrong Answer
a=int(input()) b=int(input()) c=int(input()) d=max(a,b) ans=0 for i in range(d): if d*i>=c: print(i) exit()
p02717
s223426668
Accepted
X, Y, Z = map(int, input().split()) print(Z, X, Y)
p02660
s971745776
Wrong Answer
import math n = int(input()) if n == 1: print(1) exit(0) pows = [] upto = int(math.sqrt(n)) for i in range(2, upto): if n % i == 0: cc = 0 while n % i == 0: n //= i cc += 1 pows.append(cc) if len(pows) == 0: print(1) exit(0) ans = 0 # print(pows) for pp in pows: start = 1 cc = 0 while pp - start >= 0: cc += 1 pp -= start start += 1 ans += cc print(ans)
p02577
s330625267
Accepted
N=list(input()) answer=0 for n in range(len(N)): answer+=int(N[n]) if answer%9==0: print('Yes') else: print('No')
p03627
s924164271
Accepted
from collections import Counter n = int(input()) A = list(map(int, input().split())) C = Counter(A) ans = sorted([(k,v) for k,v in C.items() if v>=2], key = lambda x:-x[0])[:2] if len(ans)<2: print(0) elif ans[0][1]>=4: print(ans[0][0]**2) else: print(ans[0][0]*ans[1][0])
p02639
s356675552
Accepted
x = []*5 x = list(map(int,input().split())) for i in range(0,5): if (x[i] == 0): print(i+1)
p02594
s784527155
Accepted
X = int(input()) if X >= 30: print('Yes') else: print('No')
p03852
s800980896
Accepted
c=input() l=['a','i','u','e','o'] if c in l:print('vowel') else:print('consonant')
p02695
s205394024
Wrong Answer
#20C10のcombinatrics全探索? #本番でCでこれ見たら凍るw n,m,q=map(int, input().split( )) qs=tuple(tuple(map(int, input().split( ))) for _ in range(q)) import itertools ans=0 for comb in itertools.combinations(range(1,n+m+1),n): tmp=0 comb2=[comb[i]-i for i in range(n)] for ai,bi,ci,di in qs: if comb2[bi-1]-comb2[ai-1]==ci: tmp+=di ans=max(ans,tmp) print(ans)
p02899
s535896149
Accepted
N=int(input()) Students=list(map(int,input().split())) d={} for i in range(N): d[i+1]=Students[i] d_2 = sorted(d.items(),key=lambda x: x[1]) ans=[] for k in d_2: ans.append(k[0]) print(*ans)
p03448
s963824732
Wrong Answer
a = int(input()) b = int(input()) c = int(input()) x = int(input()) i1, i2, i3, p = 0, 0, 0, 0 while i1 <= a: while i2 <= b: while i3 <= c: m = 500 * i1 + 100 * i2 + 50 * i3 if m > x: break elif m == x: p += 1 i3 += 1 i3 = 0 i2 += 1 if m > x: break i2 = 0 i1 += 1 if m > x: break print(p)
p03385
s174691066
Accepted
import sys input = sys.stdin.readline s=input().strip() a=[] for i in range(3): a.append(s[i]) a.sort() if a[0]=="a" and a[1]=="b" and a[2]=="c": print("Yes") else: print("No")
p03860
s954685046
Wrong Answer
s = input() print('A' + s[0] + 'C')
p03206
s502735628
Accepted
d = int(input()) print('Christmas '+'Eve '*(25-d))
p03627
s283168486
Accepted
from collections import Counter n = int(input()) a = list(map(int, input().split())) counter_a = Counter(a) ok_list = [] for key,value in counter_a.items(): if value >= 4: ok_list.append(key) ok_list.append(key) elif value >= 2: ok_list.append(key) else: continue ok_list.sort(reverse=True) if len(ok_list) >= 2: ans = ok_list[0] * ok_list[1] else: ans = 0 print(ans)
p02993
s517491470
Wrong Answer
#--Security code = list(input()) if(code[0] == code[1]): print("Bad") elif(code[1] == code[2]): print("Bad") elif(code[2] == code[3]): print("Bad") else: print("Yes")
p02629
s839450360
Accepted
N=int(input()) ans="" for _ in range(10**5): N-=1 ans+=chr(ord("a")+(N%26)) N=N//26 if N<=0: break print(ans[::-1])
p02879
s116028860
Accepted
a,b=map(int,input().split()) print(a*b if (a<10 and b<10) else -1)
p03481
s758175359
Wrong Answer
x, y = map(int,input().split()) num = y/x ans = 1 while True: num /= 2 if num >= 1: ans += 1 else: break print(ans)
p02823
s653926733
Accepted
n, a, b = map(int, input().split()) ans = [max(a-1, b-1), max(n-a, n-b)] dis = abs(a-b) if dis % 2 == 0: ans.append(dis//2) else: if abs(a-b) > 2: cto = min(a, b) ans.append((dis-1)//2+cto) ctn = min(n-a, n-b) ans.append((dis-1)//2+ctn+1) print(min(ans))
p02576
s543459292
Accepted
import math N,X,T=map(int,input().split()) print(math.ceil(N/X)*T)
p03137
s820991220
Wrong Answer
import sys # N: コマ数 # M: 地点数 N,M,*X = map(int, open(0).read().split()) # コマ数が地点数以上の場合、各地点にコマを配置できる # よって 0 回の移動で目的を達成できる if N >= M: print(0) sys.exit() X.sort() D = sorted(abs(X[i+1] - X[i]) for i in range(M-1)) print(X[-1] - X[0] - sum(D[-(N-1):]))
p02784
s620764238
Accepted
h, n = map( int, input().split() ) a = list( map( int, input().split() ) ) if sum( a ) < h: print( "No" ) else: print( "Yes" )
p02613
s594473598
Accepted
a = int(input()) x = [] for i in range(a): x.append(input()) print("AC x " + str(x.count("AC"))) print("WA x " + str(x.count("WA"))) print("TLE x " + str(x.count("TLE"))) print("RE x " + str(x.count("RE")))
p03555
s097644061
Wrong Answer
import math a=input() b=input() print("YES" if a[0]==b[2] and b[0] ==a[2] else "NO")
p03544
s890108554
Accepted
L = [2, 1] for _ in range(2, 86 + 1): L.append(L[-1] + L[-2]) print(L[int(input())])
p02598
s159781447
Accepted
n,k,*a=map(int,open(0).read().split()) l,r=0,10**9 while~l+r: x=l+r>>1 if-sum(-b//x+1for b in a)>k:l=x else:r=x print(r)
p03087
s265507860
Accepted
n,q = map(int,input().split()) s =str(input()) l = [0]*n r = [0]*n for i in range(1,n): if s[i] == 'C': if s[i - 1] == 'A': l[i] = 1 r[i] = 1 for i in range(1, n): l[i] = l[i] + l[i - 1] r[i] = r[i] + r[i - 1] for i in range(q): a,b = map(int,input().split()) print(r[b - 1] - l[a -1])
p02993
s291809952
Accepted
S = input() for i in range(len(S)-1): if S[i] == S[i+1]: print("Bad") exit() print("Good")
p03730
s538228518
Wrong Answer
a, b, c = map(int, input().split()) if a%b!=0: if a%2==0 and b%2 == 0 and c%2==0: print("Yes") elif a%2==0 and b%2==1 and c%2==1: print("Yes") elif a%2==1 and b%2==0 and c%2==1: print("Yes") elif a%2==1 and b%2==1 and c%2==0: print("Yes") else: print("No") else: print("No")
p03262
s421986863
Wrong Answer
n, xx = map(int, input().split()) x = list(map(int, input().split())) x.append(xx) x.sort() dis = 10 ** 9 for i in range(n): dis = min(dis, x[i + 1] - x[i]) print(dis)
p02597
s084509281
Accepted
N = int(input()) C = input() l = 0 while l < N and C[l] == "R": l += 1 r = N-1 while r > 0 and C[r] == "W": r -= 1 ans = 0 while l < r: if C[l] == "W" and C[r] == "R": ans += 1 l += 1 r -= 1 elif C[l] == "W": r -= 1 elif C[r] == "R": l += 1 else: l += 1 r -= 1 print(ans)
p02571
s958440783
Accepted
def main(): S = list(input()) T = list(input()) ans = float('inf') for i in range(len(S)): cnt = 0 flag = True for j in range(len(T)): if i + j >= len(S): flag = False break if S[i+j] != T[j]: cnt += 1 if flag: ans = min(ans, cnt) print(ans) if __name__ == "__main__": main()
p02971
s554684117
Accepted
N = int(input()) A = [int(input()) for _ in range(N)] SA = list(reversed(sorted(A))) for a in A: if a == SA[0]: print(SA[1]) else: print(SA[0])
p02779
s823160302
Wrong Answer
n = int(input()) a = sorted([int(i) for i in input().split()]) ans = 'Yes' for i in range(1, n): if a[i-1] == a[i]: ans = 'No' break print(ans)
p02767
s174937490
Accepted
import math n = int(input()) x = list(map(int, input().split())) y = round((2*sum(x))/(2*n)) ans = 0 for i in range(n): ans += (y-x[i])**2 print(ans)
p03544
s926836364
Wrong Answer
n= int(input()) a,b,c = 2,1,3 for i in range(n-1): a,b,c=b,c,b+c print(a)
p02691
s699856498
Accepted
N = int(input()) L = [0] * (404040) A = map(int, input().split()) ans = 0 for i, a in enumerate(A): ia = i - a if ia >= 0: ans += L[ia] ai = a + i if ai < 404040: L[ai] += 1 print(ans)
p02854
s343148812
Accepted
N=int(input()) A=list(map(int,input().split())) s=ans=sum(A) k=0 for i in range(N-1): k+=A[i] ans=min(ans,abs(s-2*k)) print(ans)
p02730
s551504443
Wrong Answer
s = input() s1 = s[:int((len(s)-1) / 2)] s1r = s1[::-1] s2 = s[int((len(s)+1) / 2):] s2r = s2[::-1] if s1 == s1r and s2 == s2r: print('Yes') else: print('No')
p03261
s214020087
Wrong Answer
n = int(input()) words = [] for i in range(n): words.append(input()) if len(words) != len(set(words)): print("No") else: for i in range(n-1): if words[i][-1] != words[i+1][0]: print("No") break print("Yes")
p02987
s101698210
Accepted
#132_A s=input() print('Yes' if len(set(s))==2 and all(s.count(s[i]) for i in range(4)) else 'No')
p03705
s061286817
Accepted
N, A, B = map(int, input().split()) if B < A: print(0) elif N == 1 and A!= B: print(0) elif N == 1 and A == B: print(1) else: print(1 + ( N - 2) * (B - A))
p03107
s170878873
Wrong Answer
s = input() s0 = 0 s1 = 1 for c in s: if c == '0': s0 += 1 else: s1 += 1 print(min(s0, s1)*2)
p02814
s631628059
Accepted
from functools import reduce from fractions import gcd n,m=map(int,input().split()) a=list(map(int,input().split())) a=[i//2 for i in a] #print(a) lc=reduce(lambda x,y: (x*y)//gcd(x,y) , a) #print(lc) flag=True for i in a: if (lc//i)%2==0: flag=False break if flag==False: print(0) else: x=m//lc print(x//2) if (x%2)==0 else print((x//2)+1)
p03695
s791173946
Accepted
# coding: utf-8 n = int(input().rstrip()) scorelist = list(map(int, input().rstrip().split(" "))) color1 = len(set([int(i/400) for i in scorelist if i < 3200])) color2 = len([i for i in scorelist if i >= 3200]) ans_min = max(1, color1) ans_max = color1 + color2 print("{} {}".format(ans_min, ans_max))
p02773
s257506829
Accepted
from collections import Counter n=int(input()) l=[input() for i in range(n)] c=Counter(l) d=max(c.values()) max_list=[k for k,v in c.items() if v==d] max_list.sort() for j in max_list: print(j)
p03379
s864569299
Wrong Answer
#!/usr/bin/env python3 n = int(input()) x = list(map(int,input().split())) a = sorted(x) base = a[n//2] for i in range(n): if x[i] > a[n//2-1] or (x[i] == a[n//2-1] and a.count(x[i]) > 1): print(a[n//2-1]) else: print(a[n//2])
p02683
s469430653
Wrong Answer
import itertools n,m,x=map(int,input().split()) l=[tuple(map(int,input().split())) for _ in range(n)] total=m*(10**5) for i in range(1, n+1): for j in itertools.combinations(range(n), i): num=0 a=[0]*m for k in j: num+=l[k][0] for m_ in range(m): a[m_] += l[k][m_+1] if len(list(filter(lambda x_: x <= x_, a))) == m: total = min(num, total) print(total)
p02554
s056590549
Wrong Answer
def pow_r(x, n): """ O(log n) """ if n == 0: # exit case return 1 if n % 2 == 0: # standard case ① n is even return pow_r(x ** 2, n // 2) else: # standard case ② n is odd return x * pow_r(x ** 2, (n - 1) // 2) total = 0 num = int(input()) for i in range(1, num): total += pow_r(2, i) print(total)
p03438
s825201213
Wrong Answer
n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) abig = 0 bbig = 0 for i in range(n): if a[i] > b[i]: abig += 1 elif a[i] < b[i]: bbig += 1 if abig % 2 == bbig % 2: print("Yes") else: print("No") print(abig, bbig)
p02847
s153285494
Accepted
d = {"SUN":7, "MON":6, "TUE":5, "WED":4, "THU":3, "FRI":2, "SAT":1} print(d[input()])
p02786
s687861140
Accepted
h = int(input()) cnt = 0 i = 1 while h > 1: cnt += i h = h//2 i *= 2 cnt += i print(cnt)
p02682
s465085863
Accepted
def solve(): a, b, c, k = map(int, input().split()) if k > a + b: ans = a - (k - a - b) print(ans) else: print(min(k, a)) if __name__ == '__main__': solve()
p02683
s212845101
Accepted
N,M,X=map(int,input().split()) A=[input().split() for _ in range(N)] ans=[] for i in range(2**N): score=[0]*M price=0 for j in range(N): if ((i>>j) & 1): price+=int(A[j][0]) for k in range(M): score[k]+=int(A[j][k+1]) if sorted(score)[0] >= X: ans.append(price) print(-1 if len(ans)==0 else min(ans))
p02602
s759093216
Wrong Answer
M = 1000000007 N, K = map(int, input().split()) A = list(map(int, input().split())) prefix = [1] * (N + 1) for i, a in enumerate(A, 1): prefix[i] = prefix[i - 1] * a prefix[i] %= M prev = prefix[K] for i in range(K + 1, N + 1): cur = prefix[i] * pow(prefix[i - K], -1, M) cur %= M if cur > prev: print('Yes') else: print('No') prev = cur
p03627
s266566680
Accepted
N = int(input()) A = sorted(list(map(int, input().split())), reverse=True) d = {} l = [] for a in A: if a in d: d[a] += 1 if d[a] % 2 == 0: l.append(a) else: d[a] = 1 if len(l) == 2: print(l[0] * l[1]) quit() print(0)
p02832
s757518072
Wrong Answer
n=int(input()) a=list(map(int,input().split())) count=0 for i in range(n): if a[i]!=i+1-count: count=count+1 if count==0: count=-1 print(count)
p02743
s213639829
Wrong Answer
import math a,b,c=map(int,input().split()) if math.sqrt(a)+math.sqrt(b)<math.sqrt(c): print("Yes") else: print("No")
p03339
s594581920
Accepted
n=int(input()) s=list(input()) c=[0 for _ in range(n)] c[0]=s[1:].count('W') for i in range(1,n): if s[i-1] =='W' and s[i]=='W': c[i]=c[i-1]-1 elif s[i-1]=='E' and s[i]=='E': c[i]=c[i-1]+1 else: c[i]=c[i-1] print(n-1-max(c))
p03309
s519480402
Accepted
N = int(input()) A = list(map(int,input().split())) for i in range(N): A[i] -= (i+1) A.sort() idx = N//2 ans = 0 for i in range(N): ans += abs(A[i]-A[idx]) print(ans)
p03434
s671802086
Wrong Answer
N = int(input()) A = list(map(int,input().split())) Alice = 0 Bob = 0 A.sort(reverse=True) if N%2 == 0: for i in range(int(N/2)): Alice += A[2*i] Bob += A[2*i+1] print(Alice-Bob) else: for i in range(int((N-1)/2)): Alice += A[2*i] Bob += A[2*i+1] Alice += A[-1] print(Alice-Bob)
p02818
s506095304
Accepted
import sys sys.setrecursionlimit(10 ** 7) read = sys.stdin.buffer.read input = sys.stdin.buffer.readline def inputS(): return input().rstrip().decode() readlines = sys.stdin.buffer.readlines A, B, K = map(int, input().split()) if K <= A: A -= K print(A, B) elif K <= (A+B): B -= (K-A) print(0, B) else: # (A+B) < K print(0, 0)
p03696
s192360537
Wrong Answer
N = int(input()) S = input().strip() C = {"(":0,")":0} for i in range(N): C[S[i]] += 1 x = C["("]-C[")"] if x>=0: S = S+")"*x else: S = "("*(-x)+S print(S)
p02910
s067488183
Accepted
S = input() odd = ["R", "U", "D"] even = ["L", "U", "D"] flag = True for i in range(len(S)): if (i + 1) % 2 == 0: if S[i] not in even: print("No") flag = False break else: if S[i] not in odd: print("No") flag = False break if flag: print("Yes")
p02862
s758265677
Accepted
mod = 7+10**9 def ncr(n,c,mod): x = 1 y = 1 for i in range(n-c+1,n+1): x = x*i%mod for j in range(1,c+1): y = y*j%mod return (x * pow(y, mod-2, mod)) % mod X, Y = map(int, input().split()) if (X+Y) % 3 != 0: print(0) exit() n = (2*Y-X) // 3 m = (2*X-Y) // 3 if n < 0 or m < 0: print(0) exit() ans = ncr(n+m,n,mod) print(ans)
p03457
s151989685
Wrong Answer
n = int(input()) x = 0 y = 0 t = 0 c = [] for i in range(n): c.append(list(map(int,input().split()))) for i in range(n): t = c[i][0] - t a = c[i][1] b = c[i][2] if (t - abs((x+y) - (a+b))) %2 == 0 and abs((x+y) - (a+b)) <= t: x = a y = b else: print("No") exit() print("Yes")
p03730
s693760635
Accepted
a,b,c = map(int,input().split()) cnt = 0 for i in range(b): cnt += a if cnt % b == c: print("YES") exit() print("NO")
p02959
s237015503
Accepted
n = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) ans = 0 for i in range(n): tmp = A[i] - B[i] if tmp < 0 and -tmp <= A[i+1]: A[i+1] += tmp ans += B[i] elif tmp < 0 and -tmp > A[i+1]: ans += A[i] +A[i+1] A[i+1] = 0 elif tmp >= 0: ans += B[i] print(ans)
p02767
s005947959
Accepted
def count(Xi): ans = 0 for p in range(N): ans += (X[p]-Xi)**2 return ans N = int(input()) X = [int(x) for x in input().split()] l =[] for i in range(101): l.append(count(i)) print(min(l))
p03417
s650957279
Accepted
n, m = map(int, input().split()) if n == 1 and m == 1: result = 1 elif n == 1: result = m - 2 elif m == 1: result = n - 2 elif n == 2 or m == 2: result = 0 else: result = (n-2)*(m-2) print(result)
p02939
s180233796
Accepted
S = input() now = '' prev = '' ans = 0 for s in S: now += s if now!=prev: ans += 1 prev = now now = '' print(ans)
p03160
s418363346
Wrong Answer
N = int(input()) lst = [int(x) for x in input().split()] dp = [10 ** 5 for _ in range(N)] dp[0] = 0 dp[1] = abs(lst[1] - lst[0]) for i in range(N - 1): dp[i + 1] = min(dp[i + 1], dp[i] + abs(lst[i + 1] - lst[i])) if i < N - 2: dp[i + 2] = min(dp[i + 2], dp[i] + abs(lst[i + 2] - lst[i])) print(dp[N - 1])
p03778
s086694735
Accepted
W, a, b = map(int,input().split()) if (a+W)<=b: print(b-(a+W)) elif (a<= b)and (b<(a+W)): print(0) elif ((a-W)<=b) and(b<a): print(0) elif b<(a-W): print(a-(b+W))
p03359
s683228095
Wrong Answer
a,b=map(int,input().split()) print(min([a,b,12]))
p02959
s120788306
Accepted
N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) ans = 0 for i,b in enumerate(B): t = min(b,A[i]+A[i+1]) ans += t #A[i]を使いきったか否か A[i+1] -= max(0, t-A[i]) print(ans)
p02691
s271358079
Accepted
import collections N = int(input()) A = list(map(int, input().split())) # ap+aq == p-q (p>q) # p-ap = q+aq mp = {} ans = 0 for p in range(N): if p-A[p]+1 in mp: ans += mp[p-A[p]+1] if p+A[p]+1 in mp: mp[p+A[p]+1] += 1 else: mp[p + A[p] + 1] = 1 print(ans)
p03407
s142050249
Accepted
a,b,c=map(int,input().split()) if (a+b)>=c: print('Yes') else: print('No')
p02723
s735531515
Wrong Answer
def coffee(string): if len(string) == 6 and string.islower(): for i in range(0,len(string)): if string[i+2] == string[i+3] and string[i+4] == string[i+5]: return 'Yes' else: return 'No' else: return 'False' print(coffee('COFFEE'))
p02958
s021013245
Wrong Answer
n=int(input()) p=list( map(int, input().split())) ans=0 for i in range(n): if p[i]!=i+1: ans=ans+1 if ans<=2: print('Yes') else: print('No')
p03804
s817140754
Accepted
n,m = map(int,input().split()) la = [] for i in range(n): la.append(input()) lb = [] for i in range(m): lb.append(input()) for i in range(n-m+1): for j in range(n-m+1): f = True for k in range(m): for l in range(m): if la[i+k][j+l] !=lb[k][l]: f = False if f: print("Yes") exit() print("No")
p02578
s898837979
Wrong Answer
n = input() s = list(map(int, input().split())) if all(s): print(0) else: print(max(s[(s.index(max(s))+1):]))
p02696
s751309653
Accepted
A, B, N = [int(n) for n in input().split()] c = min([B - 1, N]) y = (A * c - ((A * c) % B)) // B print(y)
p03309
s245515732
Wrong Answer
# https://atcoder.jp/contests/abc102/tasks/arc100_a import sys read = sys.stdin.readline def read_ints(): return list(map(int, read().split())) def read_a_int(): return int(read()) N = read_a_int() A = read_ints() B = [a - i for a, i in zip(A, range(1, N + 1))] mu = sum(B) // N ans = 0 ans1 = 0 for b in B: ans += abs(b - mu) ans1 += abs(b - mu - 1) print(min(ans, ans1))
p02909
s446436758
Wrong Answer
S = list(input()) for i in range(0,len(S),2): if S[i] == 'L': print('No') exit() for j in range(1,len(S),2): if S[j] == 'R': print('No') exit() print('Yes')
p03543
s871685260
Accepted
s = input() if s[0]==s[1]==s[2] or s[3]==s[1]==s[2]: print('Yes') else: print('No')