problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p03693 | s195794975 | Wrong Answer | print("YENOS"[max(int(input().replace(" ",""))%4,1)::2]) |
p03035 | s080632356 | Wrong Answer | def main():
a,b = map(int, input().split())
if a>=13:
print(b)
elif 6<=a<=12:
print(b/2)
else:
print(0)
main() |
p02768 | s004502386 | Accepted | def comb_mod(n,r):
mod = 10**9+7
ans = 1
for i in range(r):
ans *= n-i
ans %= mod
for i in range(1,r+1):
ans *= pow(i,mod-2,mod)
ans %= mod
return ans
def solve():
n, a, b = map(int, input().split())
mod = 10**9+7
ans = pow(2,n,mod)-comb_mod(n,a)-comb_mod... |
p03605 | s847962585 | Accepted |
import numpy as np
print("Yes"if('9' in input()) else "No") |
p03657 | s180478642 | Accepted | #!/usr/bin/env python3
A, B = map(int, input().split())
if A%3 == 0 or B%3 == 0 or (A+B)%3 == 0:
print("Possible")
else:
print("Impossible") |
p02958 | s904948076 | Accepted | n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(0, n):
if (i+1) != p[i]:
cnt += 1
if cnt < 3:
print("YES")
else:
print("NO") |
p03639 | s013743403 | Wrong Answer | N=int(input())
A=list(map(int,input().split()))
d4=len([i for i in A if i%4==0])
d2=len([i for i in A if i%2==0 and i%4!=0])
N=N-d4*3
if N==1 and d2>=2:
N=0
elif N>=2 and N-d2<=0:
N=0
print("Yes" if N<=0 else "No")
|
p03485 | s838444782 | Accepted | a, b = map(int, input().split())
if (a+b) % 2 == 0:
print((a+b)//2)
else:
print(((a+b)//2)+1) |
p03611 | s849629257 | Accepted | n = int(input())
a = list(map(int, input().split()))
count = [0]*(max(a)+1)
for i in a: count[i]+=1
if len(count) <= 2:
print(sum(count))
exit()
ans = 0
for i in range(2,max(a)):
if count[i-1]+count[i]+count[i+1] > ans:
ans = count[i-1]+count[i]+count[i+1]
print(ans) |
p02814 | s122623974 | Wrong Answer | import fractions
N,M = map(int,input().split())
A = [int(i)//2 for i in input().split()]
gcd = 1
for i in A:
gcd = gcd * i//fractions.gcd(gcd,i)
ans = M//gcd
ans = (ans+1)//2
print(ans) |
p02842 | s031879371 | Accepted | n = int(input())
for i in range(50000):
tmp=i*1.08//1
if tmp==n:
print(i)
exit(0)
print(":(") |
p03486 | s864106371 | Accepted | s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
if ''.join(s) < ''.join(t):
print('Yes')
else:
print('No')
|
p02772 | s415648360 | Accepted | N = int(input())
A = list(map(int,input().split()))
ans = 'APPROVED'
for i in range(N):
if A[i]%2 == 0:
if A[i]%3 != 0 and A[i]%5 != 0:
ans = 'DENIED'
break
print(ans)
|
p03494 | s712113064 | Accepted | def main():
n = int(input())
nums = list(map(int, input().split()))
exist_odd = False
result = 0
while True:
for i in range(n):
if nums[i] % 2 != 0:
exist_odd = True
if exist_odd:
break
nums = list(map(lambda x: x / 2, nums))
r... |
p03219 | s120903652 | Accepted | A,B = list(map(int,input().split()))
print(A+B//2) |
p02647 | s919054352 | Accepted | def im(a):
imos = [0] * (3*N+1)
for i in range(N):
imos[N+i-min(N,a[i])] += 1
imos[N+i+min(N,a[i])+1] -= 1
cs = [0]
for i in range(1,2*N+1):
cs.append(cs[i-1]+imos[i-1])
return cs[N+1:]
N,K,*A = map(int, open(0).read().split())
for i in range(K):
A = im(A)
if A.count... |
p03208 | s581757276 | Wrong Answer | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()
n, k = na()
h = [ni() for i in range(n)]
h.sort()
d = [h[i] - h[i - 1] for i in range(1, n)]
d.sort()
ans = 0
for i in range(k - 1)... |
p02823 | s059404116 | Wrong Answer | N,A,B=map(int, input().split())
def find(N,A,B):
if (A+B)%2==0:
return int((B-A)/2)
elif B-A==3:
if (A-1)<=(N-B):
A=1-A
return int((B-A)/2)
if (A-1)>(N-B):
B=2*N-B
return int((B-A)/2)
else:
return int((B-A)/2+2)
print(find(N,A,B)) |
p03821 | s445469844 | Accepted | def solve():
n = int(input())
a = []
b = []
for _ in range(n):
x,y = map(int,input().split())
a.append(x)
b.append(y)
ans = 0
for i in range(n)[::-1]:
if (a[i]+ans)%b[i]:
ans+=b[i]-(a[i]+ans)%b[i]
print(ans)
if __name__=='__main__':
solve() |
p02618 | s790060275 | Accepted | import random
def main():
D = int(input())
c = list(map(int,input().split()))
s = []
for d in range(D):
s.append(list(map(int,input().split())))
last = [0 for i in range(26)]
v = 0
for d in range(D):
print(random.randint(1,26))
if __name__ == '__main__':
... |
p02916 | s205100390 | Accepted | #B
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
cnt = 0
for i in range(n):
cnt += b[a[i]-1]
if i < n-1:
if a[i] + 1 == a[i+1]:
cnt += c[a[i] - 1]
print(cnt)
|
p03698 | s582193502 | Accepted | S = s = input()
s = set(s)
if len(S) == len(s):
print('yes')
else:
print('no') |
p02882 | s173265560 | Accepted | import math
a,b,x = map(int, input().split())
if x <= a*a*b/2:
print((180/math.pi)*math.atan(a*b*b/(2*x)))
else:
r = a*a*b-x
print((180/math.pi)*math.atan(2*r/(a**3))) |
p02693 | s864552474 | Wrong Answer | from sys import stdin
K = int(stdin.readline().rstrip())
[A, B] = [int(x) for x in input().rstrip().split()]
flag=0
K_temp=K
while(True):
if(K_temp>B):
break
if(K_temp>=A and K_temp<=B):
flag=2
break
else:
K_temp+=K
if flag==1:
print("OK")
else:
print("NG") |
p03371 | s301713436 | Accepted | a,b,c,x,y=map(int,input().split())
ans=10**9
for i in range(max(x,y)+1):
ans=min(ans,i*2*c+max(0,x-i)*a+max(0,y-i)*b)
print(ans) |
p02642 | s144324980 | Wrong Answer | from collections import defaultdict
import math
def divisors(n):
i = 1
div = []
while i <= math.sqrt(n):
if (n % i == 0):
if (n //i == i) :
div+=[i]
else:
div+=[i,n//i]
i+=1
return div
n = int(input())
arr = list(map(int,input().split()))
d = defaultdict(int)
for i in arr:
d[i]+=1
ans = 0
for... |
p02958 | s630927929 | Accepted | n=int(input(""))
list1=list(map(int,input("").split(" ")))
list2=[i for i in list1]
list1.sort()
count=0
for i in range(n):
if(list1[i]!=list2[i]):
count+=1
if(count>2):
print("NO")
else:
print("YES") |
p02606 | s120476147 | Wrong Answer | a, b, c = map(int, input().split())
print(b//c - a //c) |
p03944 | s750817740 | Accepted | W, H, N = map(int, input().split())
x = [0, W]
y = [0, H]
a = []
for i in range(N):
A = list(map(int, input().split()))
a.append(A)
for j in a:
if j[2] == 1:
x[0] = max(x[0], j[0])
elif j[2] == 2:
x[1] = min(x[1], j[0])
elif j[2] == 3:
y[0] = max(y[0], j[1])
else:
y[1] = min(y[1], j[1])
... |
p03281 | s665292927 | Accepted | n = int(input())
c = 0
a = [105,165,195]
if (n<105):
print(0)
elif (105<=n and n<135):
print(1)
elif (n >= 195):
print(5)
elif (135<=n and n<165):
print(2)
elif (165<=n and n<189):
print(3)
else:
print(4) |
p02759 | s897692736 | Accepted | import math
N = int(input())
print(math.ceil(N/2)) |
p03380 | s522400429 | Accepted | def main():
_ = int(input())
a = [int(an) for an in input().split()]
a.sort()
half_val = -(-a[-1] // 2)
dist_list = [abs(half_val - an) for an in a[:-1]]
min_index = dist_list.index(min(dist_list))
print(f'{a[-1]} {a[min_index]}')
if __name__ == '__main__':
main() |
p02835 | s337517510 | Accepted | print('bust' if sum(list(map(int, input().split()))) >= 22 else 'win') |
p02780 | s263775004 | Wrong Answer | import numpy as np
N,K = map(int,input().split())
p = list(map(int,input().split()))
l = []
for i in range(N):
l.append((1+p[i])/2)
a = [0] * N
a[0] = l[0]
for i in range(1,len(l)):
a[i] = a[i-1] + l[i]
x = a.index(max(a))
print(max(a) - a[x-K],a,l) |
p03427 | s638341828 | Accepted | n=list(input())
x=[]
for i in n:
x.append(int(i))
out=int(n[0])-1+(len(n)-1)*9
if x[1:]==[9]*(len(n)-1) or len(n)==1:
out=sum(x)
print(out) |
p03161 | s117854157 | Accepted | import sys
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
import collections
from collections import deque
input = sys.stdin.readline
def inp():
return int(input())
def inpl():
return list(map(int, input().split()))
def _dbg(obj):
print(obj, file=sys.... |
p03427 | s950639290 | Wrong Answer | n = int(input())
flag = 0
ans = 0
if len(str(n)) > 2:
ans += (len(str(n)) - 2) * 9
X = n // 10 ** (len(str(n)) - 2)
if str(n % 10 ** (len(str(n)) - 2)).count('9') == len(str(n)) - 2:
flag = 1
else:
X = n
if len(str(X)) == 1:
ans += X
else:
if X == 10:
ans += 9
flag = 0
... |
p04044 | s733526009 | Wrong Answer | N, L = map(int, input().split())
S = []
for x in range(N):
S.append(input())
S = sorted(S)
print(" ".join(S)) |
p02861 | s486780005 | Wrong Answer | import math
def distance(a, b):
return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
def recursive(pos):
if len(pos) == 1:
return 0
dist = 0
for p in range(len(pos) - 1):
dist += distance(pos[0], pos[p + 1])
return dist
N = int(input())
pos = []
for i in range(int(N)):
p ... |
p03625 | s170126791 | Accepted | import collections
n=int(input())
a=list(map(int,input().split()))
c = collections.Counter(a)
b=[0,0]
d=[0,0]
for i in c:
if c[i]>=4:
b.append(i)
elif c[i]>=2:
d.append(i)
b.sort(reverse=True)
d.sort(reverse=True)
if b[0]>d[0]:
print(b[0]*b[0])
elif b[0]<d[1]:
print(d[0]*d[1])
else:
... |
p02546 | s860076165 | Accepted | s=input()
if s[-1]=='s':
print(s+'es')
else:
print(s+'s') |
p02732 | s868668546 | Accepted | from collections import Counter
N = int(input())
A_array = list(map(int, input().split()))
Ai_dict = Counter(A_array)
def calc_comb(dct):
num = 0
for k,v in dct.items():
num += v*(v-1)/2
return int(num)
res_dict = dict([])
TotalComb = calc_comb(Ai_dict)
for n in A_array:
if not n in res_di... |
p02647 | s889194333 | Accepted | import sys,math,collections,itertools
input = sys.stdin.readline
N,K=list(map(int,input().split()))
A = list(map(int,input().split()))
for i in range(K):
imo = [0]*(N+1)
flag = 1
for j in range(N):
imo[max(0,j-A[j])] += 1
imo[min(N,j+A[j]+1)] -= 1
if j-A[j]>0 or j+A[j]+1<N:
... |
p02696 | s338164356 | Accepted | [A,B,N] = list(map(int,input().split()))
W = N//B
dammy=[]
x=N
dammy.append((A*x)//B - A * int(x/B))
x=(B * W)-1
dammy.append((A*x)//B - A * int(x/B))
print(max(dammy)) |
p03475 | s939467157 | Wrong Answer | n=int(input())
l=[list(map(int,input().split())) for i in range(n-1)]
for i in range(n-1):
t=l[i][1]
t+=l[i][0]
for j in range(i+1,n-1):
temp_t=t-l[j][1]
if temp_t<0:
t=l[j][1]
elif temp_t%l[j][2]!=0:
t+=temp_t%l[j][2]
t+=l[j][0]
print(t)
print(0) |
p03416 | s285618885 | Accepted | a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
buf=str(i)
#print(buf[0:int(len(buf)/2)],buf[int(len(buf)/2+1):])
str1=buf[0:int(len(buf)/2)]
str2=buf[int(len(buf)/2+1):]
if str1[0]==str2[1] and str1[1]==str2[0]:
ans+=1
print(ans)
|
p03386 | s685776427 | Accepted | a, b, k = map(int, input().split())
for i in range(a, min(b, a+k-1)+1):
print(i)
for i in range(max(b-k+1, a+k), b+1):
print(i)
|
p02772 | s849534878 | Accepted | N=int(input())
W = [int(x) for x in input().split()]
for i in W:
if i%2==0:
if i%10==0 or i%6==0:
pass
else:
print("DENIED")
exit()
print("APPROVED") |
p03419 | s843076034 | Accepted | import sys
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
N, M = ri_()
if N == 1 and M == 1:
print(1)
elif N == 1:
print(M - 2)
elif M == 1:
print(N - 2)
else:
print((N - 2) * (M - 2)) |
p02785 | s484241038 | Accepted | n,k = map(int, input().split())
hl = list(map(int, input().split()))
hl.sort(reverse=True)
if k >= n:
print(0)
exit()
rem_hl = hl[k:]
rem_sum = sum(rem_hl)
print(rem_sum) |
p03127 | s269276116 | Accepted | import math
from functools import reduce
def gcd(*numbers):
return reduce(math.gcd, numbers)
N = int(input())
A = list(map(int,input().split()))
print(gcd(*A)) |
p02983 | s107380949 | Accepted | import heapq
l,r = map(int,input().split())
mod = 2019
ans = 2018
if r-l>=2018:
print(0)
else:
for i in range(l,r+1):
for j in range(i+1,r+1):
ans = min(ans,(i*j)%mod)
print(ans) |
p03705 | s386102531 | Accepted | from sys import stdin
n,a,b = [int(x) for x in stdin.readline().rstrip().split()]
saisyou = a*(n-1)+b
saidai = b*(n-1)+a
if n == 1 and a!= b:
print(0)
exit()
elif a > b:
print(0)
exit()
else:
print(saidai-saisyou+1) |
p02708 | s664168504 | Wrong Answer | import sys
input = sys.stdin.readline
def main():
N, K = map(int, input().split())
NUM = [i for i in range(N+1)]
LOWER = 0
UPPER = 0
CNT = 0
for j in range(K):
LOWER += NUM[j]
UPPER += NUM[N-j]
for i in range(N+1):
if i + K >= N+1:
CNT += 1
break
... |
p03862 | s368539122 | Accepted | n, x = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(0, n-1):
if A[i] + A[i+1] > x:
diff = A[i] + A[i+1] - x
ans += diff
A[i+1] = max(0, A[i+1]-diff)
print(ans)
|
p02687 | s704591297 | Accepted | S = input()
if S == 'ABC':
print('ARC')
else:
print('ABC') |
p04045 | s831000336 | Accepted | n,k=map(int,input().split())
d=set([int(x) for x in input().split()])
for i in range(n,100001):
flag=True
for j in str(d):
if j in str(i):
flag=False
break
if flag==True:
print(i)
exit()
|
p03803 | s302228812 | Accepted | a,b=map(int,input().split())
if a==b:
print('Draw')
elif a==1 :
print('Alice')
elif b==1:
print('Bob')
elif a>b:
print('Alice')
else:
print('Bob') |
p03695 | s666583617 | Accepted | n = int(input())
a = [0 for i in range(13)]
for i in map(int, input().split()):
a[i // 400] += 1
ans = 0
add = 0
for i in range(8):
if a[i]:
ans += 1
for i in range(8,13):
if a[i]:
add += a[i]
if ans == 0:
print(1, add)
else:
print(ans, ans+add)
|
p02780 | s555833035 | Accepted | N,K = map(int,input().split())
ruiseki = [0]*(N+1)
now = 0
maximum = -999999999
ans = 0
p = list(map(int,input().split()))
for i in range(N):
now += p[i]
ruiseki[i+1] = now
for i in range(0,N-K+1):
P = ruiseki[i+K]-ruiseki[i]
if P > maximum:
maximum = P
Q = p[i:i+K]
for i in range(len(Q)... |
p03371 | s670689879 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
ans_2=A*X+B*Y
ans=min(X,Y)*2*C
mindelta=10**20
for i in range(1,max(X,Y)+1-min(X,Y)):
delta=0
if X>Y:
delta=2*C*i+A*(max(X,Y)-min(X,Y)-i)
if delta<mindelta:
mindelta=delta
if Y>X:
delta=2*C*i+B*(max(X,Y)-min(X,Y)-i)
if delta<mindelta... |
p02729 | s490639460 | Accepted | import math
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
n,m = map(int,input().split())
su = combinations_count(n+m, 2)
mm = n*m
ans = su-mm
print(str(ans)) |
p03545 | s553905538 | Accepted | s = input()
op = ['+', '-']
for i in range(2):
for j in range(2):
for k in range(2):
t = ''.join([s[0], op[i], s[1], op[j], s[2], op[k], s[3]])
if eval(t) == 7:
print(t + '=7')
quit() |
p02657 | s458706193 | Wrong Answer | a,b=map(int,input().split())
print (a,b); |
p03328 | s148855509 | Wrong Answer | a, b = map(int, input().split())
i = 1
c = 2
while i <= b:
i += c
c += 1
print(i-b) |
p03623 | s564213070 | Accepted | import sys
x,a,b = map(int,input().split())
if x < 0 or a < 0 or b < 0 or x > 1000 or a > 1000 or b > 1000:
sys.exit()
if abs(x-a) > abs(x-b):
print("B")
if abs(x-a) < abs(x-b):
print("A")
|
p02556 | s306386464 | Accepted | N = int(input())
A = []
B = []
a_max = -float("inf")
a_min = float("inf")
b_max = -float("inf")
b_min = float("inf")
for _ in range(N):
x, y = map(int, input().split())
a_max = max(a_max, x-y)
a_min = min(a_min, x-y)
b_max = max(b_max, x+y)
b_min = min(b_min, x+y)
print(max(a_max-a_min, b_max-b_min)... |
p03827 | s622852317 | Wrong Answer | N=int(input())
S=input()
ans=0
max_ans=0
for i in range(N):
if i=='I':
ans+=1
if max_ans<ans:
max_ans=ans
else:
ans-=1
print(max_ans) |
p03815 | s008376803 | Wrong Answer | import sys
import math
N = int(input())
print(math.ceil((N+1)/11*2)) |
p03719 | s996575455 | Accepted | #abc061 a
a,b,c=map(int,input().split())
if a<=c<=b:
print("Yes")
else:
print("No") |
p02802 | s516615547 | Accepted | n, m = map(int, input().split())
d = {}
for i in range(m):
p, s = input().split()
d.setdefault(p, [])
d[p].append(s)
cnt = 0; correct = 0
for v in d.values():
if "AC" not in v:
continue
correct += 1
cnt += v.index("AC")
print(correct, cnt)
|
p02628 | s042251520 | Accepted | N, K = map(int, input().split())
p = sorted(list(map(int, input().split())))
print(sum(p[:K])) |
p02712 | s783216643 | Wrong Answer | N = input()
fizz = list()
for i in range(int(N)):
if not i // 3==0 and not i//5==0:
fizz.append(i)
print(sum(fizz)) |
p03943 | s677481434 | Accepted | a,b,c = map(int,input().split())
if a + b == c:
print('Yes')
elif a + c == b:
print('Yes')
elif b + c == a:
print('Yes')
else:
print('No') |
p03910 | s648454927 | Wrong Answer | n=int(input())
if (n==1):
print(1)
exit()
if (n%2==0) :
print(n//2-1)
print(n//2+1)
else :
print(n//2)
print(n//2+1)
|
p02836 | s339304392 | Accepted | s = input()
ans = 0
for i in range(len(s) // 2):
if s[i] != s[len(s)-i-1]:
ans += 1
print(ans) |
p03417 | s340521043 | Accepted | n,m=map(int,input().split())
if m>=2 and n>=2:
print((n-2)*(m-2))
elif m==1 and n>=2:
print(n-2)
elif n==1 and m>=2:
print(m-2)
else:
print(1) |
p03163 | s174359777 | Wrong Answer | N,W = map(int,input().split())
w = []
v = []
for i in range(N):
x,y = map(int,input().split())
w.append(x)
v.append(y)
dp = [[0]*(W+1) for j in range(N+1)]
for i in range(N):
for j in range(W+1):
if j < w[i]:
dp[i][j] = dp[i+1][j]
else:
dp[i][j] = max(dp[i+1][j]... |
p03035 | s297138913 | Accepted |
a, b = map(int, input().split())
if a >= 13:
print(b)
elif 6 <= a <= 12:
b = int(b/2)
print(b)
elif a <= 5:
print(0) |
p02701 | s179637052 | Wrong Answer | import collections
a = input().strip().split()
number = a.pop(0)
clist = collections.Counter(a)
print(len(clist)) |
p03211 | s966608265 | Wrong Answer | s = input()
arr = []
for i in range(0, len(s) - 2):
arr.append(753 - int(str(s[i]) + str(s[i + 1]) + str(s[i + 2])))
print(min(arr)) |
p02843 | s274408038 | Accepted | x = int(input())
d = x%100
c = 0
for i in [5,4,3,2,1]:
c += d//i
d = d%i
if c*100 + x%100 > x:
print(0)
else:
print(1) |
p02640 | s416137398 | Accepted | import math
import sys
import itertools
from math import gcd
from math import sqrt
from sys import stdin
def input() : return stdin.readline().rstrip()
def mips():
return map(int,input().split())
def ii():
return int(input())
sys.setrecursionlimit(10**9)
X,Y = mips()
#X = tsuru + kame
#Y = 2 * tsuru + 4 * kame... |
p03994 | s280782128 | Wrong Answer | s = input()
K = int(input())
for i,c in enumerate(s):
x = ord('z')-ord(c)+1
if x <= K:
s = s[:i]+'a'+s[i+1:]
K -= x
print(s[:-1]+chr((ord(s[-1])-ord('a')+K)%26+ord('a'))) |
p02959 | s737331424 | Wrong Answer | n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range(n):
if b[i]<=a[i]: ans+=b[i]
elif b[i]>a[i]+a[i+1]:
ans+=a[i]+a[i+1]
a[i+1]=0
else:
ans+=b[i]
a[i+1]+a[i]-b[i]
print(ans) |
p03150 | s251503053 | Wrong Answer | import math
import sys
import collections
import bisect
readline = sys.stdin.readline
def main():
keyence = "keyence"
s = list(readline().rstrip())
lenS = len(s)
cnt = 0
for i in range(lenS):
if keyence[cnt] == s[i]:
cnt += 1
if cnt == 7:
print("YES")
... |
p03359 | s469587027 | Wrong Answer | a, b = map(int, input().split())
s = min(a, b)
cnt = 0
print(s)
for i in (str(s+1)):
if a == i and b == i:
cnt += 1 |
p02983 | s695598761 | Wrong Answer | l,r = map(int, input().split())
d,e = map(lambda x: x%2019, (l,r))
print((d*(d+1))%2019) if d < e else print(0) |
p02793 | s028883364 | Wrong Answer | N=int(input())
A=list(map(int,input().split()))
import fractions
ans=A[0]
for i in range(1,N):
ans=ans*A[i]//fractions.gcd(ans,A[i])
w=0
for i in A:
w+=(ans//i)%(10**9+7)
print(w) |
p03386 | s980584140 | Accepted | A,B,K = map(int,input().split())
if (2*K)<(B-A+2):
for i in range(A,A+K):
print(i)
for i in range(B-K+1,B+1):
print(i)
else:
for i in range(A,B+1):
print(i) |
p02789 | s187124616 | Accepted | n,m=map(int,input().split())
print("Yes" if n==m else "No") |
p02600 | s137416024 | Accepted | def main():
import sys
def input():
return sys.stdin.readline()[:-1]
X=int(input())
A=[399.99+200*i for i in range(8)]
A.append(X)
A.sort()
print(9-A.index(X))
if __name__ == '__main__':
main() |
p03623 | s342872115 | Accepted | x,a,b = map(int,input().split())
print('A' if abs(x-a) < abs(x-b) else 'B') |
p03486 | s858068477 | Accepted | #!/usr/bin/env python
# coding: utf-8
# In[71]:
s = input()
t = input()
# In[74]:
s_list = "".join(sorted(s))
t_list = "".join(sorted(t, reverse=True))
if s_list < t_list:
print("Yes")
else:
print("No")
# In[ ]:
|
p02988 | s142309066 | Accepted | n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(1,n-1):
if a[i-1] < a[i] < a[i+1] or a[i-1] > a[i] > a[i+1]:
ans += 1
print(ans)
|
p03206 | s630056907 | Wrong Answer | print("Christmas", "Eve"*(25-int(input()))) |
p03261 | s921452394 | Accepted | n = int(input())
w = [input()]
for i in range(n-1):
s = input()
if s in w or w[i][-1] != s[0]:
print("No")
exit()
w.append(s)
print("Yes") |
p04019 | s415616237 | Accepted | S = input()
l = list(set(S))
if len(l) == 0:
print("Yes")
elif len(l) % 2 == 1 :
print("No")
else :
if ("N" in l and "S" in l) or ("W" in l and "E" in l) :
print("Yes")
else :
print("No")
|
p03262 | s065377245 | Accepted | import fractions as math
n,x = map(int,input().split())
s = list(map(int,input().split()))
a = []
for i in s:
a.append(abs(i-x))
tmp = a[0]
for i in range(1,len(a)):
tmp = math.gcd(tmp,a[i])
print(tmp) |
p03625 | s258912865 | Accepted | n = int(input())
d = {}
for ai in input().split():
ai = int(ai)
if ai not in d:
d[ai] = 0
d[ai] += 1
n2 = [k for k in d if d[k] > 1]
n4 = [k for k in d if d[k] > 3]
n2.sort(reverse = True)
n4.sort(reverse = True)
ans = 0
if n4:
ans = n4[0] ** 2
if len(n2) > 1:
ans = max(ans, n2[0] * n2[1])
print(ans... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.