problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03407
s703295479
Wrong Answer
a,b,c=map(int,input().split()) if c<=(a+2*b):print('Yes') else:print('No')
p03998
s824695072
Wrong Answer
a = input() b = input() c = input() s = "" s = a for i in range(len(a) + len(b) + len(c)): if s[0] == "a": s = a[1:] a = a[1:] elif s[0] == "b": s = b[1:] b = b[1:] else: s = c[1:] c = c[1:] if 0 in [len(a), len(b), len(c)]: break if len(a) ==...
p03944
s203747223
Wrong Answer
w,h,n = [int(x) for x in input().split()] xy = [] for _ in range(n): tmp = [int(x) for x in input().split()] xy.append(tmp) r = w u = h l = 0 b = 0 for z in xy: if z[2] == 1: l = max(l, z[0]) elif z[2] == 2: r = min(r, z[0]) elif z[2] == 3: b = max(b, z[1]) elif z[2] ==...
p02572
s772456139
Wrong Answer
def main(): MOD = 10**9 + 7 n = int(input()) a = list(map(int, input().split())) a_sum = sum(a) ans = 0 for i in range(n): ans += a[i] * (a_sum - a[i]) ans %= MOD print(ans//2) if __name__ == '__main__': main()
p03817
s807825096
Wrong Answer
x = int(input()) ans = 0 if x >= 11: ans += x*2 // 11 x %= 11 while x > 0: x -= [6,5][ans%2] ans += 1 print(ans)
p02909
s695824642
Accepted
S = input() W_list = ['Sunny','Cloudy','Rainy','Sunny'] i = 0 while i < 4: if W_list[i] == S: print(W_list[i+1]) break else: i = i+1
p03545
s840978434
Accepted
s = list(input()) for i in range(1<<3): form = "" for j in range(3): form += s[j] if i & 1<<j: form += "+" else: form += "-" form += s[-1] if eval(form) == 7: print(form + "=7") exit()
p02802
s206131048
Accepted
# 2020/01/12 n,m=map(int,input().split()) ps=[0]*(n+1) ac=0 wa=0 for i in range(m): p,s=input().split() p=int(p) if ps[p]>0:continue if s=='WA': ps[p]-=1 else: wa+=-ps[p] ps[p]=1 ac+=1 print(*[ac,wa])
p04005
s548267888
Wrong Answer
import sys input = sys.stdin.readline def main(): ans = 0 A,B,C = map(int, input().split()) if A*B*C%2 == 1: ans = A*B print(ans) if __name__ == '__main__': main()
p04011
s627169507
Wrong Answer
N = int(input()) K = int(input()) X = int(input()) Y = int(input()) if N-K <= 0: price = K*X else: price = K*X +(N-K)*Y print(price)
p02554
s173183778
Accepted
n=int(input()) mod=10**9+7 al=10**n ex=8**n a=9**n x=al-ex ans=x-(a-ex)*2 print(ans%mod)
p03986
s571613240
Accepted
import sys def input(): return sys.stdin.readline().rstrip() from collections import deque def main(): X=input() stack=deque() for x in X: if x=='S' or (x=='T' and (not stack or stack[-1]=='T')): stack.append(x) elif stack and stack[-1]=='S': stack.pop() print(len...
p03485
s540099733
Wrong Answer
def adva(a, b) : c = (a + b) / 2 return round(c)
p02880
s501807423
Accepted
N = int(input()) for i in range(1, 10): if N%i==0 and N//i<10: print("Yes") exit(0) print("No")
p02947
s548955687
Accepted
from sys import stdin import copy n = int(input()) S = [stdin.readline()[:-1] for i in [0]*(n)] #S.append(stdin.readline()) s = [] for i in S: s.append("".join(sorted(i))) s.sort() arr = [] temp = 1 for i in range(n-1): if temp>1 and s[i]!=s[i+1]: arr.append(temp) temp = 1 if s[i]==s[i+1]: ...
p02994
s150566346
Accepted
lst = list(map(int, input().split())) N = lst[0] L = lst[1] apple_flavours = [] for i in range(1, N+1): apple_flavours.append(L+i-1) abs_apple_flavours = [] for apple in apple_flavours: abs_apple_flavours.append(abs(apple)) min_val = min(abs_apple_flavours) index = abs_apple_flavours.index(min_val) to...
p03293
s311187417
Accepted
S = str(input()) T = str(input()) if T in S*2: print("Yes") else: print("No")
p03208
s651682880
Accepted
N,K=map(int,input().split()) h=[int(input())for _ in range(N)] h.sort() ans=10**10 for i in range(N-K+1): tmp=h[i+K-1]-h[i] if tmp<ans: ans=tmp print(ans)
p02802
s856662148
Accepted
n, m = map(int, input().split()) ps = [input().split() for i in range(m)] ac, wa = [0] * n, [0] * n wa_sum = 0 for i in ps: p, s = int(i[0]), i[1] if ac[p - 1] == 0 and s == "AC": ac[p - 1] += 1 wa_sum += wa[p - 1] else: wa[p - 1] += 1 print(sum(ac), wa_sum)
p03555
s370584636
Wrong Answer
import sys C1 = list(input()) C2 = list(input()) if C2 == C1[::-1]: print("Yes") else: print("No")
p03623
s058713938
Wrong Answer
x,a,b = map(int, input().split()) print("A") if abs(x-a) > abs(x-b) else print("B")
p02712
s334967951
Accepted
# 整数を一つ入力 N = int(input()) res = 0 for i in range(1,N+1): if i % 3 == 0: continue if i % 5 == 0: continue res += i print(res)
p02831
s257231216
Wrong Answer
a,b=sorted(map(int,input().split())) #ユークリッドの互除法 def gcd(a,b): if b==0: return a else: return (gcd(b,a%b)) #recursive function p=gcd(a,b) if b%p==0: print(b) elif a%p==0: print(a) elif p!=a and p!=b: print(p*a*b) else: print(b) #ユークリッドの互除法)
p03997
s334467328
Wrong Answer
a = int( input() ) b = int( input() ) h = int( input() ) print( ( a + b ) * h / 2 )
p03407
s515226381
Wrong Answer
A,B,C=map(int,input().split()) print(["Yes","No"][A+2*B<C])
p03087
s844048510
Accepted
from re import finditer from bisect import bisect_left from bisect import bisect_right a,b=map(int,input().split()) c=input() d=[] for _ in range(b): n,m=map(int,input().split()) d.append([n-1,m-1]) n=len(d) ac1=[m.start() for m in finditer('AC', c)] ac2=[m.end()-1 for m in finditer('AC', c)] for i in range(n):...
p02790
s602281100
Accepted
#k = int(input()) #s = input() #a, b = map(int, input().split()) #s, t = map(str, input().split()) #l = list(map(int, input().split())) a, b= map(int, input().split()) if a < b: for i in range(b): print(a, end="") else: for i in range(a): print(b, end="") print("")
p03673
s852339952
Accepted
from collections import deque n = int(input()) A = list(input().split()) a = [int(A[i]) for i in range(n)] b = deque([]) b_rev = deque([]) for i in range(n): if i % 2 == 0: b.append(str(A[i])) b_rev.appendleft(str(A[i])) else: b.appendleft(str(A[i])) b_rev.append(str(A[i])) ...
p02754
s003420468
Accepted
import sys f = sys.stdin.readline() xx = f.split(' ') x = [int(str) for str in xx] n = x[0] a = x[1] b = x[2] ab = a + b d = int(n / ab) m = n % ab if ( a > m): sum = a * d + m else: sum = a * d + a print sum sys.stdout.flush()
p03286
s985883082
Wrong Answer
#print(1//-2) n = int(input()) result = '' while n!=0: #print(n) if n%-2==0: result+='0' n = n//-2 #n+=1 else: result+='1' if n<0: n = n//-2 n+=1 else: n = n//-2 n+=1 result = result[::-1] print(result)
p02836
s494543391
Accepted
s = list(input()) if len(s)%2 == 0: s1 = s[:len(s)//2] s2 = s[len(s)//2:] else: s1 = s[:len(s)//2] s2 = s[len(s)//2+1:] #print(s1,s2) i = 0 j = -1 cnt = 0 while len(s1) > i: if s1[i] != s2[j]: cnt += 1 i += 1 j -= 1 print(cnt)
p03416
s068160838
Accepted
A, B = map(int, input().split()) result = 0 for num in range(A, B+1): num_list = list(str(num)) if (num_list[0] == num_list[4]) and (num_list[1] == num_list[3]): result += 1 print(result)
p02787
s711035606
Accepted
h,n = map(int,input().split()) dp = [[10000000000 for i in range(h+1)] for j in range(n+1)] dp[0][0] = 0 for i in range(n): a,b = map(int,input().split()) for j in range(h+1): if dp[i+1][j] > dp[i][j]: dp[i+1][j] = dp[i][j] nex = min(h,j+a) if dp[i+1][nex] > dp[i+1][j] + b:...
p02606
s415444775
Accepted
ma = lambda :map(int,input().split()) ni = lambda:int(input()) import collections import math import itertools gcd = math.gcd l,r,d = ma() c= 0 for i in range(l,r+1): if i%d==0: c+=1 print(c)
p03145
s386104525
Wrong Answer
a, b, c = map(int, input().split()) print(a * b / 2)
p03061
s794476536
Wrong Answer
#<125> import itertools import math N = int(input()) A = list(map(int, input().split())) ans = 0 for i in itertools.combinations(A, 2): ans = max(0, math.gcd(i[0], i[1])) #print(math.gcd(i[0], i[1])) print(ans)
p03086
s775184002
Wrong Answer
S = input() ans = 0 for i in range(len(S)): tmp = 0 for j in range(len(S)): if 'ACGT'.count(S[j]) == 1: tmp += 1 else: ans = max(ans, tmp) tmp = 0 print(ans)
p03339
s060705123
Accepted
N = int(input()) S = list(input()) E = S[1:].count('E') W = 0 mi = E+W for i in range(1,N): if S[i] == 'E':E -= 1 if S[i-1] == 'W':W+=1 if E+W <= mi:mi = E+W print(mi)
p03001
s131570633
Accepted
def main(): import fractions w,h,x,y=map(float,input().split()) if w/2==x and h/2==y: print(w*h/2,1) else: print(w*h/2,0) if __name__=="__main__": main()
p03478
s980466319
Accepted
## coding: UTF-8 N, A, B = map(int,input().split()) ans = 0 for i in range(1, N+1): s = str(i) w = 0 for j in range(len(s)): w += int(s[j]) if(A<= w and w <= B): ans += int(s) print(ans)
p03448
s676815997
Accepted
def main(): A = int(input()) B = int(input()) C = int(input()) X = int(input()) xa = 500 xb = 100 xc = 50 Count = 0 for i in range(A + 1): for j in range(B + 1): for k in range(C + 1): if (xa * i + xb * j + xc * k) == X: Count +=...
p03693
s108697304
Accepted
r, g, b = input().split() if int(g + b) % 4 == 0: print('YES') else: print('NO')
p02724
s051952787
Wrong Answer
x = int(input()) ans = 0 ans += (x // 500) * 1000 ans += ((x % 1000) // 5) * 5 print(ans)
p02765
s324401801
Accepted
n,r = map(int,input().split()) if n >= 10: print(r) else: print(r + 100*(10-n))
p03360
s280209579
Accepted
List = list(map(int, input().split())) List.sort() K=int(input()) for i in range(K): List[2] = List[2]*2 wa = 0 for i in range(3): wa += List[i] print(wa)
p02748
s332747560
Accepted
_, _, m = map(int, input().split()) a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] low = min(a) + min(b) for _ in range(m): x, y, c = map(int, input().split()) low = min(low, a[x - 1] + b[y - 1] - c) print(low)
p02556
s381336243
Wrong Answer
from sys import stdin readline = stdin.readline N = int(readline()) xy = [tuple(map(int, readline().split())) for _ in range(N)] xy = list(set(xy)) xy.sort() c = set(xy[:1500]) c = c | set(xy[-1500:]) xy.sort(key=lambda x: x[1]) c = c | set(xy[:1500]) c = c | set(xy[-1500:]) c = list(c) result = 0 for i in rang...
p02684
s763743822
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) R = {1:0} i, t = A[0], 1 while K > t: r = R.get(i) if r == None: R[i] = t i = A[i-1] t += 1 else: K -= r K %= t - r for k in range(K): i = A[i-1] print(i)
p03639
s219943136
Wrong Answer
N=int(input()) a=map(int,input().split()) c=0 d=0 e=0 f=0 for i in a: if i%4==0: c=c+1 elif i%2==0: d=d+1 e=N-d if d==0: if (c+1)>=e: print('Yes') else: print('No') else: if c>=0: print('Yes') else: print('No')
p02923
s935968594
Wrong Answer
n = int(input()) A = list(map(int, input().split()))[::-1] t = 0 before = A[0] - 1 max_t = 0 for i in A: if before <= i: t += 1 before = i else: max_t = max(t, max_t) t = 0 before = i print(max_t - 1)
p03680
s263397032
Accepted
n = int(input()) a = [] for _ in range(n): a_ = int(input()) a.append(a_) ans = 0 c = 1 for i in range(n): c = a[c-1] ans += 1 if c == 2: print(ans) exit() print(-1)
p03760
s799835735
Wrong Answer
o = list(input()) s = list(input()) for x,y in zip(o,s) :print(x+y,end = "")
p03352
s374837504
Wrong Answer
x = int(input()) import math while True: if(str(math.sqrt(x))[-2] == "."): print(x) exit() else: x = x - 1
p02916
s778395740
Wrong Answer
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) ans = 0 for i in range(N): ans += B[A[i]-1] for j in range(0, N-1): if A[j+1] == A[j] + 1: ans = ans + C[j-1] print(ans)
p03943
s537392490
Accepted
a=sorted(list(map(int, input().split()))) print("Yes" if a[0] + a[1] == a[2] else "No")
p03137
s922168540
Accepted
import numpy as np n,m=map(int,input().split()) x=list(map(int,input().split())) arr=np.sort(np.array(x)) dif=np.diff(arr) lis=dif.tolist() lis=sorted(lis) for i in range(n-1): if len(lis)>0: lis.pop() print(sum(lis))
p02582
s431604315
Accepted
S = input() if 'RRR' == S: print(3) elif 'RR' in S: print(2) elif 'R' in S: print(1) else: print(0)
p03998
s049597849
Accepted
Sa=input() Sb=input() Sc=input() cur=0 while True: if cur==0: if len(Sa)==0: print("A") exit() cur=ord(Sa[0])-ord("a") Sa=Sa[1:] elif cur==1: if len(Sb)==0: print("B") exit() cur=ord(Sb[0])-ord("a") Sb=Sb[1:] else: if len(Sc)==0: print("C") exit() ...
p02613
s165781527
Accepted
N = int(input()) count = [0]*4 for i in range(N): S = input() if S == 'AC': count[0] += 1 elif S == 'WA': count[1] += 1 elif S == 'TLE': count[2] += 1 else: count[3] += 1 print('AC x ' + str(count[0])) print('WA x ' + str(count[1])) print('TLE x ' + str(count[2])) pri...
p02917
s611564830
Wrong Answer
def main(): n = int(input()) B = input() B = B.split() B = [int(i) for i in B] s = 0 for i in range(0, n-1): if i == 0: s += B[0] else: s += min(B[i - 1], B[i]) s += B[-1] return s main()
p02596
s597014757
Accepted
# -*- coding: utf-8 -*- """ Created on Mon Sep 14 13:35:45 2020 @author: ezwry """ k = int(input()) a = 7 for i in range(k): a = a % k if a == 0: print(i+1) exit() else: a = a*10 + 7 print(-1)
p03241
s450200212
Wrong Answer
N, M = map(int, input().split()) quotient = M // N cnt = quotient - 2 M -= N * cnt while True: if M < N: break cnt += 1 M -= N if M % cnt == 0: ans = cnt else: ans = M % cnt print(ans)
p02612
s242705867
Wrong Answer
N = int(input()) ans = N%1000 print(ans)
p02917
s957989395
Wrong Answer
n = int(input()) b_s = list(map(int, input().split(' '))) a = 0 if n > 3: for i in range(0, n-2): b_i, a_i = b_s[i], b_s[i+1] a += (b_i if b_i <= a_i else a_i) elif n == 3: a += b_s[1] + b_s[0] * 2 elif n == 2: a += b_s[0] * 2 print(a + b_s[n-2])
p02873
s473947144
Accepted
s = list(input()) l2r = [0] r2l = [0] n = len(s) for i in range(n): if s[i] == '<': l = l2r[i] l2r.append(l+1) else: l2r.append(0) for j in range(n): if s[n-1-j] == '>': r2l.append(r2l[j]+1) else: r2l.append(0) invr2l = r2l[::-1] ans = [] for i in range(n+1): m = max(l2r[i],invr2l[i]) a...
p03001
s221453854
Accepted
# -*- coding: utf-8 -*- w, h, x, y = map(int, input().split()) def multi(w, h, x, y): core = (w/2, h/2) if (x == core[0])^(y == core[1]): return False elif x == core[0]: return True else: return False print(w*h/2, 1 if multi(w, h, x, y) else 0)
p04045
s321395682
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) while True: s=str(n) f=1 for i in range(len(s)): if s[i] in d: f=0 if f: print(n) exit() n+=1
p03557
s586404298
Accepted
def main(): import bisect N = int(input()) upper = list(map(int, input().split())) middle = list(map(int, input().split())) lower = list(map(int, input().split())) upper.sort() middle.sort() lower.sort() cnt = 0 for i in range(N): mid = middle[i] index_up = bi...
p02916
s212932240
Wrong Answer
n = int(input()) alis = list(map(int, input().split())) blis = list(map(int, input().split())) clis = list(map(int, input().split())) cache = 0 ans = 0 for i in range(n): a = alis[i] b = blis[a - 1] ans += b if cache + 1 == a: ans += clis[a - 2] cache = a print(ans)
p02996
s833732318
Accepted
n = int(input()) AB = [list(map(int,input().split())) for _ in range(n)] AB.sort(key=lambda x: x[1]) # print(AB) now = 0 ok = True for necessary, deadline in AB: # print(now) # print(necessary, deadline) if now + necessary > deadline: ok = False break now += necessary print("Yes" if ok ...
p02693
s740245923
Wrong Answer
k = int(input()) a, b = map(int, input().split()) for i in range(a, b+1): if i%k == 0: print('OK') break else: print('NG')
p03086
s020655772
Wrong Answer
s = input() n = len(s) ans = -1e9 for i in range(n): for j in range(i, n): ok = True for k in range(i, j + 1): if s[k] not in ['A', 'T', 'G', 'C']: ok = False if ok: ans = max(ans, j - i + 1) print(ans)
p03785
s352912279
Wrong Answer
n,c,k = [int(x) for x in input().split()] t = [] for _ in range(n): t.append(int(input())) t.sort() ans = 0 tmp = {"f": 0, "num": 0} for x in t: if not (x <= k + tmp["f"] and tmp["num"] <= c): ans += 1 tmp["f"] = x tmp["num"] = 0 tmp["num"] += 1 if tmp["num"] != 0: ans += 1 p...
p02759
s661221890
Accepted
N=int(input()) if N/2.0>int(N/2.0): print(int(N/2.0)+1) else: print(int((N/2.0)))
p03836
s815619270
Wrong Answer
sx,sy,tx,ty = map(int,input().split()) dx = tx-sx dy = ty-sy print("U"*dy+"R"*dx+"D"*dy+"L"*(dx+1)+"U"*(dy+1)+"R"*(dx+2)+"D"*(dy+2)+"L"*(dx+2))
p02732
s195717304
Wrong Answer
N = int(input()) a = (input().split()) a_str = ''.join(a) a_str2 = a_str sum = 0 l_dict = {} while len(a_str)>0: n = a.count(a_str[0]) sum += int(n*(n-1)/2) l_dict[a_str[0]] = n a_str = a_str.replace(a_str[0],'') for k in range(N): print(sum-l_dict[a_str2[k]]+1)
p02707
s937018206
Wrong Answer
n=int(input()) p=list(map(int,input().split())) li=[] for i in range(1,n): q=p.count(i) li.append(q) for result in li: print(result,"\n")
p03385
s247873768
Accepted
S = list(input()) if S.count('a') ==1 and S.count('b') and S.count('c'): print('Yes') else: print('No')
p02663
s117750996
Wrong Answer
h1, n1, h2, n2, k = map(int,input().split()) h = h2-h1 n = n2-n1 wake = 60*h + n-1 ans = int(wake/k) print(ans*k)
p03479
s623467539
Accepted
x,y=map(int,input().split()) cnt=0 while x<=y: x=x*2 cnt+=1 print(cnt)
p03971
s416446263
Wrong Answer
N,A,B = map(int,input().split()) S = list(input()) C = A + B ans = [] df = 0 f = 0 for i in range(N): s = S[i] if s == 'c': ans.append('No') continue elif s == 'a': df += 1 if df < C: ans.append('Yes') else: ans.append('No') elif s == 'b': df += 1 f += 1 if df < C a...
p03696
s191170276
Accepted
n=int(input()) s=input() ans=0 l=0 r=0 a=0 for i in range(n): if s[i]=="(": a=a-1 l=l+1 else: a=a+1 r=r+1 if a>ans: ans=a for i in range(ans): print("(",end="") for i in range(n): print(s[i],end="") for i in range(ans+l-r): print(")",end="") print()
p02797
s425211461
Accepted
n,k,s = map(int, input().split( )) #editorial #s..s,s+1,...s+1 #またはs,,,s,1,,,1 for i in range(k): print(s,end = " ") if s<10**9: for i in range(k,n): print(s+1,end = " ") else: for i in range(k,n): print(1,end = " ")
p02684
s085842441
Accepted
from collections import defaultdict n,k=map(int,input().split()) a=list(map(int,input().split())) order = [] now = 1 count = 0 d = defaultdict(int) for i in range(n): if d[now]!=0: s=d[now]-1 g=i break order.append(now) d[now] = i+1 now = a[now-1] if k<=s: print(order[k]...
p03038
s972651018
Wrong Answer
N, M = map(int, input().split()) A = list(map(int, input().split())) import bisect A.sort() A = [-1] + A for i in range(M): b, c = map(int, input().split()) idx = bisect.bisect_left(A, c) #print(A[:idx], A[idx:]) #A = A[:idx] + [c] * b + A[idx:] #A = A[-N:] #print(A) print(sum(A))
p03456
s386337137
Accepted
import math a,b =input().split() c = int(a + b) print('Yes' if math.sqrt(c).is_integer() else 'No')
p03997
s385133488
Accepted
inp=[int(input()) for i in range(3)] print(int((inp[0]+inp[1])*inp[2]/2))
p02556
s391241365
Accepted
n = int(input()) xy = [list(map(int, input().split())) for _ in range(n)] xy.sort() lstm = [] lstp = [] for x, y in xy: lstm.append(x-y) lstp.append(x+y) lstm.sort() lstp.sort() ans = max(lstm[-1] - lstm[0], lstp[-1] - lstp[0]) print(ans)
p03317
s201819051
Wrong Answer
n,k=map(int,input().split()) a=list(map(int,input().split())) if n<k: print(1) else: print(n//(k-1))
p02659
s551936313
Wrong Answer
A, B = map(float,input().split()) print(int(A*B))
p02553
s065002609
Accepted
import numpy as np a, b, c, d = map(int, input().split()) hoge = [] hoge.append(a*c) hoge.append(a*d) hoge.append(b*c) hoge.append(b*d) if max(hoge) < 0: if np.sign(a) != np.sign(b) or np.sign(c) != np.sign(d): print(0) else: print(max(hoge)) else: print(max(hoge))
p02548
s015710006
Accepted
N = int(input()) ans = 0 for i in range(1, N): if N % i == 0: ans += (N // i) - 1 else: ans += N // i print(ans)
p03075
s472655281
Wrong Answer
a = [int(input()) for i in range(6)] flag = True for i in range(4): for j in range(i, 5): if a[i] - a[j] > a[len(a)-1]: flag = False break if flag: print("Yay!") else: print(":(")
p02687
s496902982
Accepted
S = input() if S == "ABC": print("ARC") else: print("ABC")
p02615
s927001381
Accepted
n = int(input()) a = [int(i) for i in input().split()] ans = 0 ind = n-1 a.sort() for i in range(n-1): if i%2: ans += a[ind] else: ans += a[ind] ind -= 1 print(ans)
p03861
s557876788
Wrong Answer
#48b import math a,b,x = map(int, input().split()) first = math.ceil(a/x) end = b//x if a!=0: print(end - first + 1) else: print(end - first)
p02860
s988985879
Wrong Answer
import sys N = int(input()) s = input() if N%2 != 1: print('No') sys.exit() if s[:N//2] == s[N//2+1:]: print('Yes') else: print('No')
p02946
s950207281
Accepted
k, x = list(map(int, input().split())) if k == 1: print(x) else: lower = [] upper = [] for i in range(1, k): lower.append(x-i) upper.append(x+i) res = lower[::-1] + [x] + upper r = [str(x) for x in res] print(" ".join(r))
p02819
s975196732
Accepted
a = int(input()) for i in range(a,100005): flag = 0 for j in range(2,i): if j*j < i: if i % j == 0: flag = 1 break if flag == 0: ans = i break print(ans)
p02602
s113281331
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) for i in range(N-K): if A[K+i] > A[i]: print("Yes") else: print("No")