problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02571
s499206120
Wrong Answer
import sys input = sys.stdin.readline S = input() T = input() if len(S) - len(T) > 0: score_list = [] for i in range(0, len(S) - len(T) + 1): s = S[i:i+len(T)] if len(s) != len(T): continue score = sum([1 if s[i]==T[i] else 0 for i in range(len(s))]) score_list.append(score) print(len(T) - max(score_list)) elif len(S) == len(T): score = sum([1 if S[i]==T[i] else 0 for i in range(len(S))]) print(len(T) - score)
p02583
s093209474
Wrong Answer
gross = int(input()) numbers = input().split() numbers = sorted(numbers) count = 0 for n in range(gross-2): for m in range(gross-1): for l in range(gross): if (n < m) and (m < l): if (int(numbers[n]) != (int(numbers[m]))) and (int(numbers[n]) != (int(numbers[l]))) and (int(numbers[m]) != (int(numbers[l]))): if (int(numbers[n]) + int(numbers[m])) > int(numbers[l]): count += 1 print(count)
p03328
s782278751
Wrong Answer
a, b = map(int, input().split()) h = 0 for i in range(1, 999): h += i if h >= a: print(h - a) exit()
p02700
s871257013
Wrong Answer
A, B, C, D = map(int, input().split()) while 0==0: D -= B # print(D) if D <= 0: print("Yes") exit(0) A -= C # print(A) if A <= 0: print("No") exit(0)
p04044
s913569631
Wrong Answer
n,l = [int(i) for i in input().split()] ss = [input() for _ in range(n)] ss.sort() for s in ss: print(s, sep="") print("")
p02882
s087822339
Accepted
from math import atan2, degrees a,b,x = map(int, input().split()) s = x/a if x >= a**2*b/2: print(degrees(atan2(2*(a*b-s)/a, a))) else: print(degrees(atan2(b, 2*s/b)))
p03556
s103640303
Accepted
from sys import stdin import math n=int(input()) n=int(math.sqrt(n)) print(n*n)
p03377
s589128144
Accepted
A,B,X=map(int,input().split()) if A<=X and A+B>=X: print("YES") else: print("NO")
p03285
s226969064
Wrong Answer
import math N = int(input()) flag = False for i in range(math.ceil(N/7)): for j in range(math.ceil(N/4)): if N - i * 7 - j * 4 == 0: flag = True if flag == True: print('Yes') else: print('No')
p03633
s504526040
Accepted
from collections import Counter,defaultdict,deque from heapq import heappop,heappush,heapify from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readline().split())) n = inp() a = [inp() for _ in range(n)] now = a[0] for i in range(1,n): now = a[i]*now//fractions.gcd(a[i],now) print(now)
p03862
s456422923
Accepted
n,x=map(int,input().split()) a=list(map(int,input().split())) ret =0 if a[0]>x: ret+=a[0]-x a[0]=x for i in range(1,n): if a[i-1]+a[i]>x: ret+=a[i-1]+a[i]-x a[i]=max(0,x-a[i-1]) print(ret)
p02695
s911849072
Wrong Answer
A,B,N=map(int,input().split()) x=min(B-1,N) print(int(A*x/B)-A*int(x/B))
p03013
s666341568
Accepted
import sys N, M = map(int, sys.stdin.readline().strip().split()) A = set() for _ in range(M): A.add(int(sys.stdin.readline())) # i段目の階段への到達方法の数 dp = [0 for _ in range(N+1)] dp[0] = 1 dp[1] = 0 if 1 in A else 1 for i in range(2, N+1): if i in A: continue dp[i] = dp[i-1] + dp[i-2] dp[i] %= 1000000007 print(dp[N])
p03485
s361024376
Accepted
import math a, b = map(int, input().split()) print(math.ceil((a+b)/ 2))
p03262
s653050871
Accepted
from functools import reduce from fractions import gcd N, X = map(int, input().split()) x = list(map(int, input().split())) res = list(abs(i-X) for i in x) # resの最大公約数を求める。 コードは reduce(gcd, list) print(reduce(gcd, res))
p02779
s730194786
Accepted
N = int(input()) li = list(map(int, input().split())) li.sort() S = 1 for i in range(N-1): if li[i+1] == li[i]: S = S*0 else: S = S if S == 0: print('NO') else: print('YES')
p03997
s927836318
Accepted
a = int(input()) b = int(input()) c = int(input()) print(int((a+b)*(c//2)))
p03351
s669118635
Accepted
a,b,c,n=map(int,input().split()) if abs(c-a)<=n: print("Yes") elif abs(c-b)<=n and abs(b-a)<=n: print("Yes") else: print("No")
p03131
s709229483
Accepted
k,a,b = map(int,input().split()) if a >= b-2: print(k+1) else: d = k-(a-1) e = a e += (b-a)*(d//2) e += d%2 print(e)
p02959
s539926929
Accepted
n=int(input()) a=[int(x) for x in input().rstrip().split()] b=[int(x) for x in input().rstrip().split()] ans=0 for i in range(len(b)): if a[i]+a[i+1]<=b[i]: ans+=a[i]+a[i+1] a[i]=0 a[i+1]=0 elif a[i]<=b[i]: ans+=a[i] ans+=(b[i]-a[i]) a[i+1]=a[i+1]-(b[i]-a[i]) else: a[i]-=b[i] ans+=b[i] print(ans)
p03720
s705252455
Wrong Answer
N,M=map(int, input().split()) dic={} for n in range(M): for x in map(int, input().split()): if x in dic.keys(): dic[x]+=1 else: dic[x]=1 [print(v) for v in dic.values()]
p03495
s256225232
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) a=[0]*200001 cnt=0 for i in range(N): if a[A[i]]==0: cnt+=1 a[A[i]]+=1 a.sort(reverse=True) sum=0 for i in range(cnt-K): sum+=a[cnt-i-1] print(sum)
p02583
s960140060
Accepted
n=int(input()) c=sorted(list(map(int, input().split()))) ans = 0 for i in range(n-2): for j in range(i+1,n-1): for k in range(j+1,n): if c[i] != c[j] and c[k] != c[i] and c[k] != c[j]: if c[i] + c[j] > c[k]: ans += 1 print(ans)
p03698
s385417720
Accepted
s = input() lst1 = [] for i in range(len(s)): lst1.append(s[i]) lst1.sort() lst2 = list(set(lst1)) lst2.sort() if lst1 == lst2: print('yes') else: print('no')
p02622
s230127745
Wrong Answer
s = 'abcde' t = 'bcdea' n = len(s) cnt = 0 for i in range(n): if s[i] != t[i]: cnt += 1 print(cnt)
p02697
s820947160
Accepted
N,M = list(map(int, input().split())) if N%2 == 1: for i in range(1,M+1): print(i, N-i) else: # N=8 M=3 (8,1), (4,6), (7,2) # N=10, M=4 (10,1), (5,7), (9,2), (4,8) for i in range(M): if i%2 == 0: x = i//2 print(N-x, 1+x) else: cent = N//2+1 x = i//2+1 print(cent-x, cent+x)
p03220
s882529955
Accepted
n = int(input()) t, a = map(int, input().split()) h = list(map(int, input().split())) temp = list(map(lambda x: abs(a - (t-0.006*x)), h)) p = temp.index(min(temp)) print(p + 1)
p03262
s657027429
Wrong Answer
import fractions N, X = map(int, input().split()) x = list(map(int, input().split())) tmp = x[0] for i in range(1,N): tmp = fractions.gcd(tmp,x[i]) print(tmp)
p02696
s507050958
Wrong Answer
import math a, b, n = map(int, input().split()) ab = a/b maxi = 0 st = max(0, n-a-1) for x in range(st, n+1): z = 0 z = math.floor(ab * x) - a * math.floor(x/b) if z > maxi: maxi = z for x in range(0, a): # z = 0 if x < b: z = math.floor(ab * x) else: z = math.floor(ab * x) - a * math.floor(x/b) if z > maxi: maxi = z print(maxi)
p03309
s330066673
Wrong Answer
N=int(input()) A=list(map(int,input().split())) B=[A[i]-(i+1) for i in range(N)] b=sum(B)//N ans=0 for i in range(N): ans+=abs(B[i]-b) print(ans)
p02726
s476087305
Accepted
N,X,Y = map(int, input().split()) ans = [0]*(N-1) for i in range(1, N+1): for j in range(i+1, N+1): if j <= X: ans[j-i-1] += 1 elif i <= X: ans[min(j-i, X-i+1+abs(Y-j))-1] += 1 elif i < Y: ans[min(j-i, i-X+abs(j-Y)+1)-1] += 1 else: ans[j-i-1] += 1 for a in ans: print(a)
p02958
s587399630
Accepted
N=int(input()) p=list(map(int,input().split())) P=sorted(p) n=0 for i in range(N): if p[i]!=P[i]: n+=1 if n<=2: print('YES') else: print('NO')
p03943
s992411376
Accepted
a, b, c = map(int, input().split()) if a + b == c or a + c == b or b + c == a: print('Yes') else: print('No')
p03106
s329760182
Accepted
# -*- coding: utf-8 -*- a, b, k = map(int, input().split()) counter = 0 num_list = [] for i in range(max(a, b)): if a % (i + 1) == 0 and b % (i + 1) == 0: num_list.append(i + 1) print(num_list[::-1][k - 1])
p03698
s575717946
Accepted
from sys import exit S = input() for i in range(len(S)): for j in range(i): if S[i] == S[j]: print('no') exit(0) for j in range(i+1,len(S)): if S[i] == S[j]: print('no') exit(0) print('yes')
p02842
s444525335
Accepted
n=int(input()) dic={} for i in range(1,50001): p=int(i*1.08) dic[p]=i if n in dic: print(dic[n]) else: print(":(")
p03623
s954394565
Accepted
x, a, b = map(int, input().split()) print("A" if abs(a-x) < abs(b-x) else "B")
p02730
s856766332
Accepted
S = input() N = len(S) if S == S[::-1]: Sfor = S[:int((N-1)/2)] if Sfor == Sfor[::-1]: Slat = S[int((N+1)/2):] if Slat == Slat[::-1]: print("Yes") else: print("No") else: print("No") else: print("No")
p03448
s241017403
Accepted
# 500yen A = int(input()) # 100 B = int(input()) # 50 C = int(input()) # total amount and 50 multiple of 50 X = int(input()) res = 0 for c500 in range(A+1): for c100 in range(B+1): for c50 in range(C+1): total = 500*c500 + 100*c100 + 50*c50 if ( X == total): res += 1 print(res)
p03407
s809914608
Wrong Answer
A,B,C = map(int,input().split()) if (A + B*2 >= C): print("Yes") else: print("No")
p03071
s110719275
Wrong Answer
a,b=input().split() a=int(a) b=int(b) if a-b>=2: print(2*a-1) if b-a>=2: print(2*b-1) else: print(a+b)
p03086
s121320341
Accepted
s = input() acgt = [0] tmp = 0 for i in range(len(s)): if s[i] in ['A', 'C', 'G', 'T']: tmp += 1 elif tmp > 0: acgt.append(tmp) tmp = 0 acgt.append(tmp) print(max(acgt))
p03067
s322626816
Accepted
# Tenka1 Programming Beginner Contest 2019: A – On the Way a, b, c = map(int, input().split()) print('Yes' if a < c < b or b < c < a else 'No')
p03679
s439589289
Wrong Answer
x,a,b=map(int, input().split()) if b<a: print("delicious") elif a+x>b: print("dangerous") else: print("safe")
p02790
s054640358
Accepted
a, b = list(map(int, input().split())) print(str(min(a, b)) * max(a, b))
p02958
s450548817
Accepted
N=int(input()) p=list(map(int,input().split())) buf=0 ans=p.copy() count=0 list2=[] #print(ans==pdash) ans.sort() #print(ans) #print(ans==pdash) flag=0 for i in range(N): if not(ans[i]==p[i]): count=count+1 if (count==0)or(count==2): print("YES") else: print("NO")
p03943
s791675273
Accepted
a, b, c = map(int, input().split()) if max(a, b, c) * 2 == a + b + c: print("Yes") else: print("No")
p03695
s049716375
Wrong Answer
N = int(input()) a = [int(c) for c in input().split()] c = [0]*8 over = 0 for i in range(N): if a[i]>=3200: over+=1 else: c[a[i]//400]+=1 mi = 8-c.count(0) if mi+over>8: ma = 8 else: ma = mi+over print(mi,ma)
p02677
s937578923
Accepted
import math hour_hand_speed = (2 * math.pi) / (12 * 60) minute_hand_speed = (2 * math.pi) / 60 hour_hand, minute_hand, hour, minute = list( map(int, input().split()) ) elapsed_time = 60 * hour + minute hour_hand_angle = elapsed_time * hour_hand_speed minute_hand_angle = minute * minute_hand_speed angle_btw_hour_minute = abs(hour_hand_angle - minute_hand_angle) distance = math.sqrt( hour_hand**2 + minute_hand**2 - (2 * hour_hand * minute_hand * math.cos(angle_btw_hour_minute)) ) print(distance)
p03043
s662858022
Accepted
import math n,k = map(int,input().split()) num = 0 for i in range(1,n + 1):#サイコロの出た目 if i >= k: num += 1 / n else: num += (1 / (n * (2 ** math.ceil(math.log(k / i,2))))) print(num)
p03795
s111422131
Accepted
def main(): n = int(input()) print(800 * n - 200 * (n // 15)) if __name__ == '__main__': main()
p03289
s570660122
Wrong Answer
import sys s = input() l = len(s) if s[0] != "A": print("WA") sys.exit() ss = s[2:l-1] if ss.count("C") != 1: print("WA") sys.exit() cidx = ss.find("C")+2 sss = s[1:cidx]+s[cidx+1:] print(sss) if sss.islower(): print("AC") sys.exit() print("WA")
p02598
s079732399
Accepted
def f(x): now = 0 for i in range(n): now += (a[i]-1)//x return now <= k n, k = map(int, input().split()) a = list(map(int, input().split())) ng = 0 ok= int(1e9) while ok - ng > 1: x = (ok + ng) // 2 if f(x): ok = x else: ng = x print(ok)
p02700
s799817746
Accepted
# -*- coding: utf-8 -*- TT, TA, AT, AA = map(int, input().split()) while True: AT = AT - TA # T attack if (AT <= 0): print("Yes") break TT = TT - AA #A attack if (TT <= 0): print("No") break
p02748
s689316752
Wrong Answer
s = input() if s.replace('hi','') == '': print('Yes') else: print('No')
p02847
s392971500
Accepted
s = input() if s =="SUN": print("7") if s =="MON": print("6") if s =="TUE": print("5") if s =="WED": print("4") if s =="THU": print("3") if s =="FRI": print("2") if s =="SAT": print("1")
p03625
s505323043
Accepted
n=int(input()) a=list(map(int,input().split())) a.sort() l=[] i=0 while i<n-1: if a[i]==a[i+1]: l.append(a[i]) i+=2 else: i+=1 l.reverse() if len(l)<2: print(0) else: print(l[0]*l[1])
p03951
s492339189
Accepted
n = int(input()) s = input() t = input() ans = n * 2 for i in range(n): if s[i:] == t[:n-i]: ans -= n - i break print(ans)
p02771
s296507345
Accepted
l=list(map(int,input().split())) if(l[0]==l[1]==l[2]): print("No") elif l[0]==l[1] or l[0]==l[2] or l[1]==l[2]: print("Yes") else: print("No")
p03345
s027777155
Wrong Answer
A, B, C, K = map(int, input().split()) if K==0: print(A-B) else: if B-A<=10**18: print(B-A) else: print("Unfair")
p02576
s370986884
Accepted
n, x, t = map(int,input().split()) if (n%x == 0): y = n//x*t print(y) else: y = n//x + 1 y = y*t print(y)
p02789
s084029832
Accepted
n,m = map(int, input().split()) if n == m: print("Yes") else: print("No")
p02743
s813782270
Accepted
a, b, c = map(int,input().split()) #if math.sqrt(a)+math.sqrt(b) < math.sqrt(c): if c-a-b> 0 and (c-a-b)**2 > 4*a*b: print("Yes") else: print("No")
p03035
s284788102
Accepted
A, B = map(int, input().split()) if A >= 13: print(B) elif A>=6: print(B//2) else: print(0)
p02987
s701163281
Accepted
word = input() list_word = list(word) if list_word.count(list_word[0]) == 2 and list_word.count(list_word[1]) == 2 and list_word.count(list_word[2]) == 2: print('Yes') else: print('No')
p02622
s721460820
Accepted
S=input() T=input() a=0 for n in range(len(S)): if S[n] != T[n]: a+=1 print(a)
p02947
s519314345
Accepted
N = int(input()) D = {} for i in range(N): S = input() L = [S[j] for j in range(10)] L.sort() s = "" for j in range(10): s = s[:] + L[j] if s in D: D[s] += 1 else: D[s] = 1 p = 0 for i in D: p += (D[i]*(D[i]-1))//2 print(p)
p02995
s673985938
Wrong Answer
import fractions a,b,c,d = map(int,input().split()) ans = b - a + 1 cd = c*d/fractions.gcd(c,d) tmp = int(b / c) - int((a-1) / c) tmp2 = int(b / d) - int((a-1) / d) tmp3 = int(b / cd) - int((a-1) / cd) print(ans - tmp - tmp2 + tmp3 )
p02642
s305711653
Wrong Answer
lst=[] c=0 flag=0 n = int(input()) str = input() lst = str.split(' ') #for i in range(0,n): # lst[i] = int(lst[i]) lst.sort() #print(lst) for i in range(0,n): flag=0 for j in range(0,i): if int(lst[i])%int(lst[j])==0: flag=1 j=i if flag==0: c = c+1 print(c)
p02691
s541030342
Accepted
n = int(input()) a = list(map(int, input().split())) b = [] c = [] for i in range(n): b.append(-(i + 1 + a[i])) c.append(a[i] - i - 1) #print(a) #print(b) #print(c) counts = {} result = 0 counts[b[0]] = 1 for i in range(1, n): x = c[i] # print(x) #print(counts) if x in counts: result += counts[x] y = b[i] if y in counts: counts[y] += 1 else: counts[y] = 1 print(result)
p03035
s413921290
Wrong Answer
a, b = map(int, input().split()) if a >= 13: print(b) elif 6 <= a <= 12: print(b/2) else: print(0)
p03485
s299539709
Wrong Answer
n=list(map(int,input().split())) print(sum(n)//len(n))
p02606
s905808442
Wrong Answer
L, R, d = list(map(int, input().split())) if L%d == 0 or R%d == 0: print(1+ R//d - L//d) else: print(R//d - L//d)
p03254
s398842769
Accepted
n,x=map(int,input().split()) a=list(map(int,input().split())) b=[0]*n a.sort() cnt=0 for i in range(n): if a[i]<=x: x-=a[i] if i==n-1 and x!=0: break cnt+=1 else: break print(cnt)
p03013
s502016298
Accepted
n,_,*l=map(int,open(0).read().split()) s=set(l) p,t=0,1 for i in range(n): p,t=t,(p+t)%(10**9+7)*(not{i+1}&s) print(t)
p02554
s190563996
Accepted
n=int(input()) mod=10**9+7 def power_func(a,n,mod): bi=str(format(n,"b")) res=1 for i in range(len(bi)): res=(res*res)%mod if bi[i]=='1': res=(res*a)%mod return res x=power_func(10,n,mod) y=power_func(9,n,mod) z=power_func(8,n,mod) ans=(x-(y-z)*2-z)%mod print(ans)
p02771
s521725298
Wrong Answer
def main(): A, B, C = input().split() if A == B and A == C: print("Yes") else: print("No") if __name__ == "__main__": main()
p02793
s419575276
Wrong Answer
N=int(input()) A=list(map(int,input().split())) DIV=10**9+7 def gcd(a,b): if a<b: a,b=b,a while a%b!=0: a,b=b,a%b return b def lcd(a,b): return a*b//(gcd(a,b)) sums=0 L=1 for i in range(N): newL=lcd(L,A[i]) if newL!=L: sums=(sums*(newL//L)+newL//A[i])%DIV L=newL print(sums)
p02818
s678580492
Wrong Answer
a,b,k=map(int,input().split()) a,b = max(0,a-k) , b-max(k-a,0) print(a,b)
p03131
s851855832
Accepted
k,a,b=map(int,input().split()) cnt=0 if b<a+2: print(k+1) else: if k>=a+1: k-=a+1 cnt+=b q,modulo=divmod(k,2) cnt+=q*b-q*a+modulo print(cnt) else: print(k+1)
p03607
s126262267
Wrong Answer
from collections import defaultdict n = int(input()) li = [] for i in range(n): li.append(int(input())) dic = defaultdict(int) for i in li: if dic[i] == 0: dic[i] = 1 elif dic[i] == 1: dic[i] = 0 ans = 0 for i in li: if dic[i] == 1: ans += 1 print(ans)
p02909
s273713147
Accepted
""" author : halo2halo date : 9, Jan, 2020 """ import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) W = ['Sunny', 'Cloudy', 'Rainy'] A = readline().decode('utf8').rstrip() print(W[(W.index(A) + 1) % 3])
p03328
s971920121
Wrong Answer
a, b = map(int, input().split()) h = 0 for i in range(1, 1000): h += i ans = (2*h + i+1 - a - b)/2 if ans > 0: print(ans) exit()
p03427
s479189241
Accepted
def solve(): N = input() if len(N) == 1: print(int(N)) elif all(i == '9' for i in N[1:]): print(int(N[0]) + 9 * (len(N) - 1)) else: print((int(N[0]) - 1) + 9 * (len(N) - 1)) if __name__ == "__main__": solve()
p02744
s708864578
Wrong Answer
n = int(input()) alpha = "abcdefghijklmnopqrstuvwxyz" inp = [""] for i in range(n): # ふかさのループ out = [] for j in range(len(inp)): # リストのループ for k in range(i): # アルファベットのループ out.append(inp[j] + alpha[k]) out.append(inp[j] + alpha[i]) inp, out = out, inp for i in range(len(inp)): print(inp[i])
p02947
s089806501
Accepted
n = int(input()) from collections import defaultdict dic = defaultdict(int) for i in range(n): s = "".join(list(sorted(input()))) dic[s] += 1 #print(dic) cnt = 0 for k,v in dic.items(): cnt += v*(v-1)//2 print(cnt)
p02657
s441726972
Accepted
a,b = map(int, input().split()) print(a*b)
p02970
s435147138
Accepted
n,d=map(int,input().split()) print(n//(2*d+1)+1 if n%(2*d+1)!=0 else n//(2*d+1))
p02554
s218022514
Accepted
# author: Taichicchi # created: 13.09.2020 21:21:37 import sys N = int(input()) MOD = (10 ** 9) + 7 ans = (10 ** N - ((9 ** N) * 2 - (8 ** N))) % MOD print(ans)
p02618
s643648260
Accepted
for i in range(365): print(i%26+1)
p02993
s506974653
Wrong Answer
s=input() if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]: print("Good") else: print("Bad")
p02831
s252608089
Accepted
from fractions import gcd a,b=map(int,input().split()) gcd=gcd(a,b) ans=a*b//gcd print(ans)
p02743
s010125292
Accepted
import math a, b, c = map(int, input().split()) if c > a - b and 4 * a * b < (c - a - b) ** 2: print('Yes') else: print('No') # 4 * a * b < (c - a - b) ** 2
p03693
s539670995
Wrong Answer
r, g, b = map(int, input().split()) if (r * 100+ g*10+ b) % 4 == 0: print('Yes') else: print('No')
p02873
s072024773
Accepted
s=input() ans1=[] ans1.append(0) now=0 for i in s: if i == "<": now+=1 else: now=0 ans1.append(now) ans2=[] ans2.append(0) now=0 for i in reversed(s): if i == ">": now+=1 else: now=0 ans2.append(now) ans=[] for i in range(len(ans1)): ans.append(max(ans1[i],ans2[len(ans1)-i-1])) print(sum(ans))
p02602
s756687781
Accepted
import numpy as np #import math #from decimal import * #from numba import njit #@njit def main(): N,K = map(int, input().split()) A = np.array(list(map(int, input().split()))) for b in (A[:N-K] < A[K:]): print('Yes' if b else 'No') main()
p03785
s031398902
Accepted
import sys n, c, k = [int(i) for i in sys.stdin.readline().split()] t_ls = [] for i in range(n): t = int(sys.stdin.readline().strip()) t_ls.append(t) t_ls.sort() last = t_ls[0] cnt = 1 ans = 1 for t in t_ls[1:]: if t <= last + k and cnt < c: cnt += 1 continue last = t cnt = 1 ans += 1 print(ans)
p02953
s974284404
Accepted
n = int(input()) h = list(map(int,input().split())) ans = 'Yes' for i in range(n-1): if h[i] > h[i+1]: h[i+1] += 1 if h[i] > h[i+1]: ans = 'No' print(ans)
p03644
s087222624
Accepted
n = int(input()) c = 0 max_c = 0 max_num = 1 for i in range(1, n+1): if i % 2 == 0: j = i c = 1 j /= 2 while j % 2 == 0: c += 1 j /= 2 if c > max_c: max_c = c max_num = i print(max_num)
p02835
s719960808
Accepted
a,b,c=map(int,input().split()) if 22<=a+b+c: print("bust") else: print("win")