problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03211
s325228007
Accepted
s=input() s_length=len(s) target=753 ans=753 for i in range(s_length-2): comp=int(s[i:i+3]) ans=min(abs(target-comp),ans) print(ans)
p03545
s908364791
Accepted
abcd = input() for i in range(2**3): eq = '' for j in range(3): eq += abcd[j] if(i >> j) & 1: eq += '+' else: eq += '-' eq += abcd[-1] if eval(eq) == 7: print(eq + '=7') break
p02862
s979807631
Wrong Answer
import sys sys.setrecursionlimit(10**7) x,y=map(int,input().split()) sum=0 def chess(i,j): a=0 if i == x and j == y: a+=1 return a elif i>x or j>y: return 0 elif i<x and j<y: return chess(i+1,j+2)+chess(i+2,j+1) return a print(chess(0,0)//10**9+7)
p03035
s759582400
Wrong Answer
a,b = map(int,input().split()) if a <= 5: print(0) elif 6 <= a <= 12: print(b/2) else: print(b)
p02916
s763064870
Accepted
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) ans = 0 pre = -2 for i in A: ans += B[i-1] if pre + 1 == i: ans += C[i-2] pre = i print(ans)
p02911
s273271827
Wrong Answer
n,k,q = map(int,input().split()) a = [int(input()) for A in range(q)] ans = [k]*(n+1) for i in range(1,q): ans[a[i-1]] += 1 for j in range(1,n+1): ans[j] -= q ans.pop(0) for h in range(n): print("Yes" if ans[h] > 0 else "No")
p02753
s898119154
Accepted
s = input() if 'A' in s and 'B' in s: print('Yes') else: print('No')
p02661
s249480873
Wrong Answer
n = int(input()) info = [list(map(int, input().split())) for i in range(n)] if n % 2 == 1: info = sorted(info) l = info[n // 2][0] info = sorted(info)[::-1] r = info[n // 2][1] print(r - l + 1) else: info = sorted(info) l, lmax = info[n // 2 - 1] del info[n // 2 - 1] info = sorted(info)[::-1] rmin, r = info[n // 2 - 1] print((lmax - l + 1) + (r - rmin + 1) - 1)
p03109
s954131293
Wrong Answer
s = raw_input() month = int(s[5:7]) if month > 5: print "TBD" else: print "Heisei"
p03077
s749254055
Accepted
n=int(input()) mb=[int(input()) for i in range(5)] print(-(-n//min(mb))+4)
p02784
s318970246
Accepted
h, n = map(int, input().split()) a = list(map(int, input().split())) sum_a = sum(a) if sum_a >= h: print("Yes") else: print("No")
p02583
s618915615
Accepted
import itertools n = int(input()) l = list(map(int, input().split())) ans = 0 for a,b,c in itertools.combinations(l,3): if abs(a-b) < c < a+b and len(set([a,b,c])) == 3: ans += 1 print(ans)
p04043
s407162856
Accepted
a = list(map(int,input().split())) a.sort() if a[0]==5 and a[1]==5 and a[2]==7: print('YES') else: print('NO')
p03679
s862227683
Wrong Answer
x,a,b=map(int,input().split()) b -= a if b <= 0: print('delicious') else: if b > x: print('gangerous') else: print('safe')
p02596
s814809959
Accepted
k = int(input()) now = 7 for i in range(1, k+1): if int(now) % k == 0: print(i) break now = 10 * now + 7 now %= k else: print(-1)
p03672
s806351063
Accepted
def resolve(): s = input() for i in range(2, len(s), 2): test = s[:len(s)-i] if test[:len(test)//2] == test[len(test)//2:]: print(len(test)) exit() resolve()
p02935
s347767624
Accepted
N = int(input()) v = list(map(int,input().split())) v = sorted(v) while len(v) != 1: v[1] = (v[0]+v[1])/2 v = sorted(v[1:]) print(*v)
p02683
s061729298
Wrong Answer
N,M,X = map(int,input().split()) C=[0 for i in range(N)] A=[[] for i in range(N)] min_cost=10000000000 for i in range(N): C[i],*A[i]=map(int,input().split()) for i in range(1<<N): L=[0 for i in range(M)] cost=0 for j in range(N): if 1&(i>>j): for k in range(M): L[k]+=A[j][k] cost+=C[j] if min(L)>=X: min_cost=min(min_cost,cost) print(min_cost)
p03814
s356344027
Wrong Answer
s=input() print(len(s)-s[::-1].find('Z')-s.find('A')+1)
p03803
s632316887
Wrong Answer
A, B = map(int, input().split()) if A==B: print("Draw") elif A>B or A==1: print("Alice") else: print("Bob")
p03073
s515544574
Accepted
s=list(input()) import copy d=copy.copy(s) x=0 y=1 for i in range(len(s)-1): if s[i]==s[i+1]: if s[i+1]=='1': s[i+1]='0' else:s[i+1]='1' x+=1 if d[0]=='1': d[0]='0' else:d[0]='1' for i in range(len(d)-1): if int(d[i])==int(d[i+1]): if d[i+1]=='1': d[i+1]='0' else:d[i+1]='1' y+=1 print(min(x,y))
p02748
s553473168
Accepted
a, b, m = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) min_sum = min(A) + min(B) M = [] for i in range(m): an, bn, diff = list(map(int, input().split())) M.append(A[an - 1] + B[bn - 1] - diff) diff_min = min(M) print(min_sum if min_sum < diff_min else diff_min)
p02760
s380799898
Wrong Answer
a1,a2,a3 = map(int,input().split()) b1,b2,b3 = map(int,input().split()) c1,c2,c3 = map(int,input().split()) N = int(input()) b = [int(input()) for _ in range(N)] if a1 and a2 and a3 in b or b1 and b2 and b3 in b or c1 and c2 and c3 in b or a1 and b1 and c1 in b or a2 and b2 and c2 in b or a3 and b3 and c3 in b or a1 and b2 and c3 in b or a3 and b2 and c1 in b: print('Yes') else: print('No')
p03387
s247811302
Accepted
L = list(map(int, input().split())) L.sort() d1 = L[-1] - L[-2] d2 = L[-1] - d1 - L[0] if d2 % 2 == 0: print(d1 + d2 // 2) else: print(d1 + d2 // 2 + 2)
p02818
s700873465
Accepted
a, b, k = map(int, input().split()) if a - k < 0: print(0, max(0, b - abs(a - k))) else: print(a - k, b)
p02707
s807918104
Accepted
N = int(input()) A = list(map(int,input().split())) l = [0]*N for i in A: l[i-1] += 1 print(*l)
p03720
s549255149
Accepted
n,m=map(int,input().split()) deg=[0]*n for i in range(m): a,b=map(int,input().split()) a-=1 b-=1 deg[a]+=1 deg[b]+=1 print(*deg,sep="\n")
p02831
s979911884
Accepted
import math a, b = map(int, input().split()) def lcm(x, y): return (x * y) // math.gcd(x, y) print(lcm(a, b))
p03767
s742268315
Wrong Answer
N = int(input()) A = list(map(int,input().split())) ls = [[] for i in range(N)] A.sort() for i in range(3*N): ls[i%N].append(A[i]) ans = 0 for i in range(len(ls)): k = ls[i] k.sort() ans += k[1] print(ans)
p02554
s238825841
Accepted
import sys N=int(sys.stdin.readline().strip()) mod=10**9+7 print (pow(10,N,mod)-(pow(9,N,mod)*2-pow(8,N,mod)))%mod
p02838
s363703140
Accepted
N = int(input()) A = list(map(int, input().split())) mod = 10**9 + 7 ans = 0 for i in range(60): X = sum([1 for x in A if (x >> i) & 1]) ans += (1 << i) * X * (N - X) ans %= mod print(ans)
p02880
s101966433
Wrong Answer
x=int(input()) t=1 #a=[11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79] for i in range(1,10): if t==0:break for k in range(1,i+1): if k*i==x: print('Yes') t=0 break else:print('No')
p03126
s296183671
Accepted
N,M = map(int, input().split()) B = [0]*30 for i in range(N): K, *A = map(int, input().split()) for a in A: B[a-1] += 1 print(sum(c == N for c in B))
p03774
s759529872
Accepted
n,m = map(int, input().split()) students = [list(map(int, input().split())) for _ in range(n)] chkpoints = [list(map(int, input().split())) for _ in range(m)] dist = 0 ans = 0 for student in students: min_dist = 1000000000 for i in range(m): dist = abs(student[0]-chkpoints[i][0])+abs(student[1]-chkpoints[i][1]) if dist < min_dist: min_dist = dist ans = i+1 print(ans)
p03624
s424691308
Wrong Answer
s=sorted(input()) for i in range(len(s)): s[i]=ord(s[i]) s.append("*") x=0 a=97 while s[x]==a: x+=1 a+=1 print(chr(a) if a<122 else None)
p02759
s691989949
Accepted
n=int(input()) if n%2==0: print(int(n/2)) elif n%2==1: print(int((n+1)/2))
p02911
s997692716
Accepted
n,k,q=map(int,input().split()) a=list((k-q) for i in range(n)) for i in range(q): s=int(input()) a[s-1]+=1 for i in range(n): if(a[i]>0): print("Yes") else: print("No")
p02665
s306954446
Accepted
from sys import exit def log2(x): ans = 0 while(x): x //= 2 ans += 1 return ans n = int(input()) n += 1 a = list(map(int, input().split())) cnt = 1 ans = 0 s = [0 for i in range(n)] s[-1] = a[-1] for i in range(n - 2, -1, -1): s[i] = s[i + 1] + a[i] for i in range(n): cnt = cnt * 2 - a[i] * 2 if (i + 1 < n): ans += min(cnt, s[i + 1]) if (cnt < 0): print(-1) exit(0) print(ans + 1)
p02771
s776796085
Accepted
a,b,c = map(int, input().split()) if a==b==c: print('No') elif a==b or b==c or a==c: print('Yes') else: print('No')
p02761
s384000629
Accepted
N, M = [int(i) for i in input().split()] S = [list(map(int,input().split())) for _ in range(M)] bag =[] for i in range(1000): ans = str(i) if len(ans) == N: for j in range(M): if ans[S[j][0]-1] != str(S[j][1]): break else:# インナーループがbreakで終了しなかった bag.append(i) if len(bag) != 0: print(min(bag)) else: print(-1)
p03069
s396059580
Accepted
N = int(input()) S = input() A = [0] for s in S: if s == '.': A.append(A[-1] + 1) else: A.append(A[-1]) ans = float('inf') for i in range(N + 1): ansi = (i - A[i]) + (A[-1] - A[i]) ans = min(ans, ansi) print(ans)
p03698
s233286087
Wrong Answer
s=input() l=list(set(s)) if len(s)==len(l): print("Yes") else: print("No")
p03624
s208040207
Wrong Answer
alp = 'abcdefghijklmnopqrstuvwxyz' d = {c:False for c in alp} s = open(0).read().rstrip() for c in list(s): d[c] = True for c,b in d.items(): if not b: print(c) break
p02702
s566409141
Wrong Answer
import sys S = sys.stdin.readline() N = len(S) count = 0 for i in range(N - 3): for j in range(i + 4, N + 1): num = int(S[i:j]) if num % 2019 == 0: count += 1 print(count)
p03711
s858906461
Accepted
lisa=[1,3,5,7,8,10,12] lisb=[4,6,9,11] lisc=[2] x,y=map(int,input().split()) if (x in lisa)and(y in lisa): print("Yes") elif (x in lisb)and(y in lisb): print("Yes") elif (x in lisc)and(y in lisc): print("Yes") else: print("No")
p03796
s660632132
Wrong Answer
n = int(input()) ans=1 for i in range(1,n): ans*=i ans=ans%(1000000007)
p03241
s482058912
Accepted
N, M = map(int, input().split()) import math divisor=[] for i in range(1, math.ceil(math.sqrt(M))+1): if M%i==0: divisor.append(i) #print(divisor) divisor+=[M//val for val in reversed(divisor)] #print(divisor) for val in divisor: if val>=N: print(M//val) break
p02861
s068786517
Accepted
import itertools import math def dist(i, j): return math.sqrt((coords[i][0] - coords[j][0]) ** 2 + (coords[i][1] - coords[j][1]) ** 2) n = int(input()) coords = [tuple(map(int, input().split())) for _ in range(n)] ans = [] for item in itertools.permutations(range(n)): length = 0 for i in range(n-1): length += dist(item[i], item[i+1]) ans.append(length) print(sum(ans) / len(ans))
p02996
s251606703
Wrong Answer
n = int(input()) AB = [list(map(int, input().split())) for _ in range(n)] print(AB) AB.sort(key=lambda x: (x[1], -x[0])) print(AB) time = 0 for a, b in AB: time += a if time > b: print('No') break else: print('Yes')
p02958
s317083144
Wrong Answer
import sys def I(): return int(sys.stdin.readline().rstrip()) def IL(): return map(int,sys.stdin.readline().rstrip().split()) def Main(): n = I() p = list(IL()) flag = 2 for i in range(1,len(p)): if p[i-1]!=p[i]-1: flag -= 1 if flag>=0: print('YES') else: print('NO') return if __name__=='__main__': Main()
p02719
s984913373
Accepted
n, k = map(int, input().split()) m = n % k print(min(m, abs(m-k)))
p02555
s205254134
Accepted
S=int(input()) a = [0]*(2000+1) a[3]=1 for i in range(4, S+1): a[i] = a[i-3] + a[i-1] mod=10**9+7 print(a[S]%mod)
p02933
s549389503
Accepted
a = int(input()) b = input() if a >= 3200: print(b) else: print('red')
p03475
s677241916
Wrong Answer
N = int(input()) M = [list(map(int, input().split())) for _ in range(N-1)] def dfs(i): DP = [99999999999999] * N DP[i] = M[i][1] for j in range(i+1, N): prev = DP[j-1] + M[j-1][0] start = M[j-1][1] + M[j-1][0] if start >= prev: DP[j] = start else: DP[j] = prev + ( prev - M[j-1][1] ) % M[j-1][2] print(DP[N-1]) for i in range(N-1): dfs(i) print(0)
p03408
s506202400
Accepted
N = int(input()) s = [input() for i in range(N)] M = int(input()) t = [input() for i in range(M)] ans, cur = 0, 0 for i in range(N): ans = max(ans, s.count(s[i]) - t.count(s[i])) print(ans)
p04029
s163769468
Accepted
n = int(input()) print((1+n)*n//2)
p03617
s446301421
Accepted
from decimal import Decimal Q,H,S,D = [int(i) for i in input().split()] costs = [[Q,Decimal("0.25")], [H,Decimal("0.5")], [S,Decimal("1")], [D,Decimal("2")]] costs.sort(key=lambda x: Decimal(x[0]) / x[1]) N = int(input()) tc = 0 for c, a in costs: tc += c * (N // a) N %= a print(int(tc))
p02730
s733026039
Wrong Answer
s=input() flag=True n=len(s) if s!=reversed(s): flag=False if s[:(n-1)//2]!=reversed(s[:(n-1)//2]): flag=False if s[(n+3)//2-1:]!=reversed(s[(n+3)//2-1::-1]): flag=False print("Yes" if flag else "No")
p02973
s378552163
Accepted
import sys from bisect import bisect_right read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 def main(): N, *A = map(int, read().split()) vec = [INF] * N for a in reversed(A): vec[bisect_right(vec, a)] = a print(N - vec.count(INF)) return if __name__ == '__main__': main()
p03407
s429484971
Wrong Answer
A, B, C =map(int, input().split()) if A + B > C: print("Yes") else: print("No")
p02608
s804122121
Accepted
n = int(input()) A = [0] * n for x in range(1,100): for y in range(1,100): for z in range(1,100): if x**2 + y**2 + z**2 + x*y + y*z + z*x <= n: A[x**2 + y**2 + z**2 + x*y + y*z + z*x - 1] += 1 else: break for ans in A: print(ans)
p03723
s354663561
Accepted
a,b,c=map(int,input().split()) if any([a%2==1,b%2==1,c%2==1])==True: print(0) else: if len(set({a,b,c}))==1: print(-1) else: res=0 while all([a%2==0,b%2==0,c%2==0]): a,b,c=(b+c)//2,(a+c)//2,(a+b)//2 res+=1 print(res)
p03437
s886539046
Wrong Answer
x,y=map(int,input().split()) print(x if y%x!=0 else -1)
p02848
s183216593
Wrong Answer
num = int(input()) node = input() table = list(node) for i in table: aaa = ((ord(i)) + num) % 26 print(chr(aaa))
p02730
s301156292
Wrong Answer
word=list(input()) word_number=len(word) if word_number>=7: for i in range(int(word_number/2)): if word[i]==word[-i-1]: result='Yes' continue else: result='No' break result='Yes' else: result='No' print(result)
p02628
s953538981
Wrong Answer
fluit_num,fluit_buy=input().split() print(fluit_num,fluit_buy) p = input().split() print(p[:4])
p03699
s434255616
Accepted
N=int(input()) s=[int(input()) for _ in range(N)] ss = [s[i] for i in range(N) if s[i]%10!=0] if sum(s)%10 != 0: print(sum(s)) else: if not ss: print(0) else: print(sum(s) - min(ss))
p02642
s395731960
Wrong Answer
N = int(input()) l = [int(x) for x in input().split()] + [100001] l.sort() ans = 0 t = 0 M = [False] * 10 ** 6 for i in range(N): if not M[l[i]-1]: if l[i] != l[i+1]: ans += 1 t = l[i] while t <= 10 ** 6: M[t-1] = True t += l[i] print(ans)
p02719
s322657083
Accepted
#!/usr/bin/env python3 n, k = map(int, input().split()) print(min(n, n-n//k*k, (n+k-1)//k*k-n))
p02718
s982749864
Wrong Answer
N, M = (int(x) for x in input().split()) A = list(map(int, input().strip().split())) A.sort(reverse=True) for m in range(M): s = sum(A) if A[m] > s / (4 * M): a = True else: a = False if a == True: print("Yes") else: print("No")
p03723
s917241061
Accepted
A, B, C = map(int, input().split()) count = 0 while A%2 == 0 and B%2 == 0 and C%2 == 0: if A == B and B == C: print(-1) exit() A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 count += 1 print(count)
p03632
s145109958
Accepted
a,b,c,d=map(int,input().split()) ax=[i for i in range(a,b)] cx=[i for i in range(c,d)] AX=set(ax) CX=set(cx) print(len(AX&CX))
p02553
s067684646
Accepted
a, b, c, d = map(int, input(). split()) print(max(a * c, a * d, b * c, b * d))
p02765
s716914490
Wrong Answer
N,R = list(map(int, input().split())) S= 10-N if N >= 10: print(R) else: print(R-(100*S))
p03293
s940263939
Accepted
S = input() T = input() n = len(S) s = [] t = [] for i in S: s.append(i) for i in T: t.append(i) for i in range(n): res = s[0] for j in range(1, n): s[j-1] = s[j] s[n-1] = res if s == t: print('Yes') exit() print('No')
p03163
s780842719
Accepted
import sys input = sys.stdin.readline import numpy as np def main(): n, W = map(int, input().split()) dp = np.zeros(W+1, dtype=np.int64) for _ in range(n): w, v = map(int, input().split()) np.maximum(dp[:W-w+1]+v, dp[w:W+1], out=dp[w:W+1]) print(dp[W]) if __name__ == "__main__": main()
p03693
s659390649
Accepted
s=input().split() s=int(''.join(s)) if s%4==0: print('YES') else: print('NO')
p02642
s051997229
Accepted
a = [0]* 1000001 m = 0 input() for x in map(int, input().split()): m = max(m, x) a[x] += 1 m += 1 for i in range(1, m): if a[i]: for j in range(i + i, m, i): a[j] = 0 print(a[:m].count(1))
p03910
s261457645
Accepted
def solve(): N = int(input()) score = 0 for i in range(1, N+1): score += i if score >= N: break x = score - N res = list(range(1, x)) + list(range(x+1, i+1)) return '\n'.join(map(str, res)) print(solve())
p03719
s911945578
Wrong Answer
A, B, C = map(int, input().split()) if A <= C <= B: print('YES') else: print('NO')
p03680
s171494563
Accepted
n = int(input()) al = [] for i in range(n): a = int(input()) al.append(a) al.insert(0, 0) ans = -1 push = 1 for i in range(1, n+2): light = al[push] push = light if light == 2: ans = i break print(ans)
p02622
s769148851
Wrong Answer
# B Minor Change S = list(input()) T = list(input()) l=len(S) ct = 0 print(l) for i in range(l): if S[i] != T[i]: ct += 1 print(ct)
p02600
s074483129
Wrong Answer
X = int(input().strip()) y = 1 if X <= 599: y = 8 elif X <= 799: y = 7 elif X < 999: y = 6 elif X <= 1199: y = 5 elif X <= 1399: y = 4 elif X <= 1599: y = 3 elif X <= 1799: y = 2 print(y)
p03206
s927023681
Accepted
D = int(input()) if D == 25: print("Christmas") elif D == 24: print("Christmas Eve") elif D == 23: print("Christmas Eve Eve") else: print("Christmas Eve Eve Eve")
p03062
s089865059
Wrong Answer
N = int(input()) A = list(map(int,input().split())) B = [abs(i) for i in A] if N%2 == 0: print(sum(B)) else: print(sum(B)-min(B))
p02793
s365627671
Accepted
import sys import math import functools stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] def gcd(a, b): while b: a, b = b, a % b return a def lcm(a, b): return a * b // gcd (a, b) def lcm_n(nums): return functools.reduce(lcm, nums) n = ni() a = na() a_lcm = lcm_n(a) ans = 0 for ai in a: ans += a_lcm // ai ans %= mod print(ans)
p03274
s013010567
Accepted
n , k = map(int,input().split()) x = list(map(int,input().split())) ans = 10**9 for i in range(n-k+1): l = x[i] r = x[i+k-1] if l*r >= 0: ans = min(ans,max(abs(r),abs(l))) elif l*r < 0: ans = min(ans,r-l + min(abs(r),abs(l))) print(ans)
p03030
s880712894
Accepted
n=int(input()) a=[list(input().split())+[i] for i in range(n)] for i in range(n): a[i][1]=-int(a[i][1]) a.sort() for _,_,i in a: print(i+1)
p03612
s914763414
Accepted
N = int(input()) p = list(map(int, input().split())) ans = 0 for i in range(N): if i != N-1: if p[i] == i+1: p[i], p[i+1] = p[i+1], p[i] ans += 1 else: if p[i] == i+1: p[i], p[i-1] = p[i-1], p[i] ans += 1 print(ans)
p03145
s652407992
Accepted
l=list(map(int,input().split())) l.sort() print(int(l[0]*l[1]/2))
p02820
s053048658
Accepted
# https://atcoder.jp/contests/abc149/submissions/9213312 N, K = map(int, input().split()) R, S, P = map(int, input().split()) T = input() win_pt = {"r": P, "s": R, "p": S} pt = [0] * N for i, t in enumerate(T): if i < K: pt[i] = win_pt[t] elif i >= K and (T[i - K] != T[i] or pt[i - K] == 0): pt[i] = win_pt[t] print(sum(pt))
p03352
s690560639
Accepted
#k = int(input()) #s = input() #a, b = map(int, input().split()) #s, t = map(str, input().split()) #l = list(map(int, input().split())) #l = [list(map(int,input().split())) for i in range(n)] #a = [list(input()) for _ in range(n)] #a = [int(input()) for _ in range(n)] x = int(input()) ans = 1 for i in range(2,x+1): for j in range(2,11): if (ans < i ** j): if (i**j <= x): ans = i ** j print(ans)
p02836
s773107864
Accepted
import copy s=list(input()) s2 = copy.copy(s) s2.reverse() ans = 0 for i in range(len(s)//2): if s[i] != s2[i]: ans += 1 print(ans)
p02742
s453716821
Accepted
H,W=map(int,input().split()) if H==1 or W==1: print(1) exit(0) if W%2==0: w=W//2 ans=w*H else: w=W//2 + 1 ans=w*H ans-=H//2 print(ans)
p03416
s426458394
Accepted
A,B=map(int,input().split()) c=0 for i in range(A,B+1): s=str(i) if s[0]==s[4] and s[1]==s[3]: c+=1 print(c)
p03254
s020031199
Accepted
import sys n,x = map(int,input().split()) a = list(map(int,input().split())) a.sort() c = 0 p = x for i in range(n-1): if a[i] > p: print(c) sys.exit() else: c += 1 p -= a[i] if a[-1] == p: print(n) else: print(n-1)
p02690
s515547582
Accepted
x = int(input()) for a in range(-10000, 10001): p = a ** 5 l, r = -10000, 10001 while r - l > 1: m = (l + r) // 2 if m ** 5 <= p - x: l = m else: r = m if l ** 5 == p - x: print(a, l) exit(0)
p03524
s271566913
Accepted
S=input() A=S.count('a') B=S.count('b') C=S.count('c') if A==B and B==C: print('YES') elif A==B: if C==A-1 or C==A+1: print ('YES') else: print('NO') elif B==C: if A==B-1 or A==B+1: print('YES') else: print('NO') elif C==A: if B==A-1 or B==A+1: print('YES') else: print('NO') else: print('NO')
p02970
s656439921
Wrong Answer
n,d = map(int,input().split()) print((n+d)//(d+1))
p02879
s099530320
Wrong Answer
a, b = map(int, input().split()) if a <= 10 and b <= 10: print('-1') else: answer = a * b print(answer)