problem_id stringclasses 428 values | submission_id stringlengths 10 10 | status stringclasses 2 values | code stringlengths 5 816 |
|---|---|---|---|
p02663 | s234395004 | Wrong Answer | h = list(map(int, input().split()))
if h[1] > h[3]:
print((h[2]-h[0])*60+h[3]-h[1]-h[4])
else:
print((h[2]-h[0]-1)*60+60-h[3]+h[1]-h[4])
|
p02708 | s417840295 | Accepted | n, k = map(int, input().split())
ans = 0
for c in range(k, n+2):
ans = (ans + (c * (n-c+1) + 1)) % (10**9+7)
print(ans % (10**9+7)) |
p03861 | s551386130 | Accepted | a,b,x = map(int,input().split())
ad = (a-1)//x
bd = b//x
print(bd-ad)
|
p03545 | s196931993 | Wrong Answer | #ABC 079 C
a,b,c,d=list(input())
s="+-"
for i in range(2):
for j in range(2):
for k in range(2):
if a+s[i]+b+s[j]+c+s[k]+d==7:
print(eval(a+s[i]+b+s[j]+c+s[k]+d)) |
p03030 | s092018568 | Wrong Answer | from collections import Counter
n = int(input())
s = [input().split() for i in range(n)]
points = [int(pt) for k, pt in s]
dicts = {key:[] for key in sorted(list(set([k for k, v in s])))}
for area, pt in s:
dicts[area].append(int(pt))
for area, pts in dicts.items():
for pt in sorted(pts)[::-1]:
print(points.index(pt)+1)
|
p02608 | s459248980 | Wrong Answer | import math
N = int(input())
print(0)
print(0)
for i in range(3, N+1):
ra = math.sqrt(i - 2) - 1
ran = math.floor(ra)
ans = 0
for x in range(1, ran+1):
for y in range(1, ran+1):
for z in range(1, ran+1):
f = x**2 + y**2 + z**2 + x*y + y*z + z*x
if i == f:
ans += 1
print(ans) |
p02695 | s885251083 | Accepted | import itertools
N, M, Q = map(int, input().split())
abcd = list()
for i in range(Q):
a,b,c,d = map(int, input().split())
abcd.append((a,b,c,d))
iters = itertools.combinations_with_replacement(range(1, M+1), N)
ans = 0
for com in iters:
sum = 0
for a,b,c,d in abcd:
if(com[b-1]-com[a-1] == c):
sum += d
if(sum > ans):
ans = sum
print(ans) |
p02753 | s170699374 | Accepted | S = list(input())
s = set(S)
if len(s)!=1:
print('Yes')
else:print('No') |
p02615 | s245510114 | Accepted | n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans = a[0]
n -= 2
now = 1
while n > 0:
if n >= 2:
ans += a[now]*2
now += 1
n -= 2
elif n == 1:
ans += a[now]
n -= 1
now += 1
print(ans) |
p03105 | s204492653 | Wrong Answer | a,b,c=map(int,input().split())
print(max(b//a,c)) |
p02596 | s159971601 | Accepted |
def solve(K):
a = 7 % K
for i in range(1, K+1):
if a == 0:
return i
a = (a * 10 + 7) % K
return -1
def solve0(K):
a = 7
for i in range(0, 10000):
if a % K == 0:
return i
a = a*10+7
return -1
K = int(input())
print(solve(K))
|
p02778 | s210509834 | Accepted | print('x' * len(str(input()))) |
p03417 | s910247017 | Wrong Answer | N, M = map(int, input().split())
if N > M:
N, M = M, N
if N == 1:
M -= 2
else:
N -= 2
M -= 2
print(N * M)
|
p03075 | s101826157 | Wrong Answer | a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if k > (b-a) and k > (c-b) and k > (d-c) and k > (e-d) :
print("Yay!")
else :
print(":(") |
p03360 | s745423429 | Wrong Answer | a=list(map(int,input().split()))
a=sorted(a)
k=int(input())
g=2
for i in range(1,k+1):
f=a[2]*g
a[2]=f
g=g+2
c=a[0]+a[1]+a[2]
print(c)
|
p02933 | s533197015 | Wrong Answer | a = int(input())
s = input()
print('red' if a >= 3200 else s) |
p02789 | s930833812 | Accepted | N,M=map(int,input().split())
print('Yes' if N==M else 'No')
|
p02708 | s073412137 | Accepted | N, K = map(int, input().split())
MOD = 1000000007
min_ = sum([i for i in range(K)])
max_ = sum([i for i in range(N, N - K, -1)])
right = K - 1
left = N - (K - 1)
cnt = 0
for k in range(K, N + 2):
cnt += max_ - min_ + 1
right += 1
left -= 1
min_ += right
max_ += left
print(cnt % MOD)
|
p03705 | s371815824 | Accepted | n, a, b = map(int,input().split())
num = b - a + 1
ans = b*(n-2) - a*(n-2) + 1 if b >= a else 0
print(ans if ans >= 0 else 0) |
p03087 | s556048478 | Accepted | #n = int(input())
n, q = map(int, input().split())
#bl = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]
s = input()
acnum = [0]*(n+1)
for i in range(2, n+1):
if s[i-2:i] == 'AC':
acnum[i] += acnum[i-1]+1
else:
acnum[i] += acnum[i-1]
for i in range(q):
l, r = map(int, input().split())
print(acnum[r]-acnum[l])
|
p02829 | s372095566 | Accepted | A = int(input())
B = int(input())
l=[1,2,3]
l.remove(A)
l.remove(B)
print(l[0]) |
p02697 | s973072904 | Accepted | N,M=map(int,input().split())
a,b=1,N//2
c,d=N//2+1,N
if N%2==0:
a+=1
i=0
while i<M:
if i<M:
print(c,d)
i+=1
c,d=c+1,d-1
else:
break
if i<M:
print(a,b)
a,b=a+1,b-1
i+=1
else:
break
|
p02777 | s939902234 | Accepted | s,t = input().split()
a,b = (int(x) for x in input().split())
u = input()
if s == u:
a-=1
else:
b-=1
print(a,b) |
p03612 | s605501048 | Wrong Answer | n = int(input())
P = list(map(int, input().split()))
cnt = [0]*n
for i in range(n):
if P[i] == i+1:
cnt[i] += 1
if cnt.count(1) == 0:
print(0)
else:
ans, i = 0, 0
while i < n-1:
if cnt[i] == 1:
if cnt[i+1] == 1:
ans += 1
i += 1
i += 1
if cnt[-1] == 1:
ans += 1
print(ans)
|
p02583 | s472325450 | Accepted | from itertools import combinations
N = int(input())
L_list = list(map(int, input().split()))
ans = 0
for x, y, z in combinations(L_list, 3):
#print(x, y, z)
if x == y or y == z or z == x:
continue
if x + y > z and y + z > x and z + x > y:
ans += 1
print(ans) |
p03544 | s808436372 | Accepted | def resolve():
'''
code here
'''
N = int(input())
memo = [0 for _ in range(N+1)]
memo[:2] = [2, 1]
for i in range(2, N+1):
memo[i] = memo[i-1] + memo[i-2]
print(memo[N])
if __name__ == "__main__":
resolve()
|
p04045 | s664422588 | Accepted | n,k=map(int,input().split())
d = list(map(int,input().split()))
#print(d)
for i in range(n,10**5):
count=0
for j in range(k):
u = str(d[j])
if(str(i).count(u)==0):
count+=1
#print("count:"+str(count))
if(count==k):
print(i)
break
|
p02576 | s767990057 | Accepted | n, x, t =map(int, input().split())
k = (n + x - 1) // x
ans = k * t
print(ans) |
p04029 | s230746564 | Accepted | sum = 0
for i in range(1,int(input())+1):
sum += i
print(sum)
|
p02952 | s215560223 | Accepted | n = int(input())
answer = 0
for i in range(1,n+1):
if len(str(i))%2 == 1:
answer += 1
print(answer) |
p02663 | s584651050 | Accepted | # -*- coding: utf-8 -*-
H1, M1, H2, M2, K = map(int, input().split())
print(max((H2*60+M2) - (H1*60+M1) - K, 0)) |
p03665 | s260907865 | Accepted | n,p=map(int, input().split())
A=[int(i)%2 for i in input().split()]
t=sum(A)
if t==0:
if p==1:
print(0)
else:
print(2**n)
else:
print(2**(n-1))
|
p02627 | s059126252 | Wrong Answer | a = input()
if a.isupper():
print(a.lower())
else:
print(a) |
p03037 | s045022143 | Accepted | N, M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]
card_min = 0
card_max = N
ans = N
#print(card_min, card_max)
for l, r in LR:
if l > card_min:
card_min = l
if r < card_max:
card_max = r
#print(card_min, card_max)
ans = card_max - card_min + 1
if ans <= 0:
ans = 0
break
print(ans) |
p02994 | s295428341 | Wrong Answer | N,L = map(int,input().split())
c = 0
if L >= 0:
skip = 0
else:
if N - (-L) >= 0:
skip = L*-1
else:
skip = N-1
for i in range(N):
if i == skip:
continue
c += L+i
print(c) |
p02829 | s605927023 | Accepted | a=int(input())
b=int(input())
print(6-a-b)
|
p03360 | s546656891 | 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)]
a,b,c = map(int, input().split())
k = int(input())
ans = sum([a,b,c]) - max(a,b,c) + max(a,b,c) * 2**k
print(ans)
|
p03417 | s443134475 | Wrong Answer | n, m = map(int,input().split())
if m >= 3 and n >= 3:
print((m-2) * (n-2))
elif m >= 3 or n >= 3:
print((max(m,n)-2) * min(m,n))
else:
if (m * n) % 2 == 0:
print(0)
else:
print(m * n)
|
p03632 | s498336770 | Wrong Answer | a,b,c,d = map(int,input().split())
print(0 if c >= b else min(b,d)-c) |
p02691 | s293983123 | Accepted | n = int(input())
A=list(map(int,input().split()))
cnt=0
B=[]
C=[]
for i,a in enumerate(A):
B.append(A[i]+i)
C.append(A[i]-i)
from collections import Counter
Bd=dict(Counter(B))
Cd=dict(Counter(C))
cnt=0
for k in Bd.keys():
try:
cnt+=Bd[k]*Cd[-k]
except KeyError:
continue
print(cnt)
|
p03607 | s812241324 | Accepted | N = int(input())
rlt = 0
dic = {}
for _ in range(N):
a = input()
if a not in dic:
dic[a] = 1
else:
dic[a] += 1
for k in dic:
if dic[k] % 2 == 1:
rlt += 1
print(rlt) |
p02755 | s809323666 | Accepted | import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
def main():
a, b = map(int, input().split())
ans = 2000
for i in range(1, 1001):
if a == math.floor((i * 1.08)) - i and b == math.floor((i * 1.10)) - i:
ans = min(ans, i)
if ans == 2000:
print('-1')
else:
print(ans)
main()
|
p02621 | s699753199 | Wrong Answer | a = int(input())
print(a+a^2+a^3) |
p03625 | s824430307 | Wrong Answer | N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
A.append(0)
i=0
ans=1
d=0
while i<N:
b=A[i]
c=0
while i<N and b==A[i]:
i+=1
c+=1
if 2<=c<=3:
d+=1
ans*=b
if d==2:
break
elif 4<=c:
ans*=b*b
d=2
break
if d!=2:
print(0)
else:
print(ans) |
p02933 | s082311053 | Accepted | a = int(input())
s = input()
if a >= 3200:
print(s)
else:
print("red") |
p03455 | s740754503 | Wrong Answer | a ,b =map(int,input().split())
if (a*b)%2 ==0:
print("even")
else:
print("odd")
|
p02862 | s399181022 | Accepted | x,y=map(int,input().split())
if (x+y)%3!=0:
print(0)
exit()
if x<y:
x,y=y,x
if 2*y<x:
print(0)
exit()
mod=10**9+7
a=(2*y-x)//3
b=(2*x-y)//3
mx=10**6
k=[1]*(mx+1)
def inv(n):
return pow(n,mod-2,mod)
for i in range(mx):
k[i+1]=k[i]*(i+1)%mod
ans=(k[a+b]*inv(k[a])*inv(k[b]))%mod
print(ans) |
p02952 | s204867791 | Accepted | n = int(input())
ans = 0
for i in range(1,n+1):
if len(str(i))%2 == 1:
ans += 1
print(ans)
|
p02723 | s080324330 | Accepted | S = str(input())
print('Yes' if S[2]==S[3] and S[4]==S[5] else 'No') |
p03000 | s728469940 | Accepted | from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(map(int, input().split()))
S = list(accumulate([0]+L))
print(bisect_right(S,X)) |
p03037 | s083466250 | Wrong Answer | n,m = map(int,input().split())
ls = [i for i in range(m)]
rs = [i for i in range(m)]
cnt = 0
for _ in range(m):
ls[_],rs[_] = map(int,input().split())
maxl = max(ls)
minr = min(rs)
for nn in range(1,n+1):
if maxl <= nn or minr >= nn:
cnt += 1
print(cnt) |
p02859 | s265383235 | Accepted | s = int(input())
print(s*s) |
p03385 | s873511111 | 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)]
s = sorted(input())
if "".join(s) == "abc":
print("Yes")
else:
print("No")
|
p02952 | s792454637 | Accepted | N = int(input())
answer = 0
number_of_digits = len(str(N))
total = 0
for nth in range(1, number_of_digits + 1):
is_odd = nth % 2 is 1
if not is_odd: continue
number_of_intergers = (10 ** ((nth - 1))) * 9
total += number_of_intergers
if 10 ** nth -1 >= N:
total -= 10 ** number_of_digits - 1 - N
print(total)
|
p02677 | s137172673 | Accepted | import numpy as np
a,b,h,m=list(map(int,input().split()))
deg = min(abs(h*360/12+m*360/12/60-m*360/60),360-abs(h*360/12+m*360/12/60-m*360/60))
theta = deg * np.pi /180
ans = np.sqrt(np.power(a,2)+np.power(b,2)-2*a*b*np.cos(theta))
print(ans) |
p02744 | s846946974 | Accepted | n = int(input())
ans = [0] * n
def prc(L):
res = []
for x in L:
res.append(chr(ord('a') + x))
print(''.join(res))
while 1:
prc(ans)
for i in range(n-1, 0, -1):
temp = max(ans[:i])
if ans[i] <= temp:
ans[i] += 1
for j in range(i+1, n):
ans[j] = 0
break
else:
break |
p02790 | s061897076 | Wrong Answer | a,b=(input().split())
ai=int(a)
bi=int(b)
c1=(b*ai)
c2=(a*bi)
l=[]
l.append(str(c1))
l.append(str(c2))
l.sort
print(l[0]) |
p02899 | s596404779 | Accepted | n = int(input())
A = map(int, input().split())
L = [0] * n
for i,val in enumerate(A):
L[val-1] = i + 1
print(*L)
|
p02657 | s898867227 | Accepted | a,b = map(int,input().split())
print(a * b) |
p02630 | s513239263 | Accepted | from collections import Counter
n = int(input())
a = list(map(int,input().split()))
q = int(input())
num = Counter(a)
s = sum(a)
for _ in range(q):
b,c = map(int,input().split())
s += (c-b)*num[b]
num[c] += num[b]
num[b] = 0
print(s) |
p03469 | s043979310 | Accepted | s=list(str(input()))
s[3]='8'
print(''.join(s)) |
p02755 | s658333737 | Accepted | import sys
nums=input().rstrip().split(" ")
A=int(nums[0])
B=int(nums[1])
answer=0
for i in range(1,1500):
#print(int(i*0.08))
#print(int(i*0.1))
if int(i*0.1)==B and int(i*0.08)==A:
answer=i
print(answer)
sys.exit()
if answer==0:
answer=-1
print(answer)
|
p02706 | s435291985 | Accepted | NM = list(map(int, input().split()))
N, M = NM[0],NM[1]
a = list(map(int, input().split()))
x = 0
for i in range(M):
x += a[i]
if x > N:
print(-1)
else:
print(N - x) |
p02996 | s903599932 | Wrong Answer | import heapq
n = int(raw_input())
heap = [map(int, raw_input().split(' '))[::-1] for _ in range(n)]
heapq.heapify(heap)
#(deadline, duration)
def f(heap):
t = 0
while(heap):
nd,ct = heapq.heappop(heap)
gap = nd - t
while(heap and heap[0][0] == nd):
u,v = heapq.heappop(heap)
t += v
gap -= v
if gap < 0: return False
while(heap and heap[0][1] <= gap):
_,v = heapq.heappop(heap)
gap -= v
t += v
return True
print 'Yes' if f(heap) else 'No' |
p03264 | s929414210 | Accepted | k=int(input())
if k % 2 == 0:
print(k // 2 * k // 2)
else:
print(k // 2 * (k // 2 + 1)) |
p03059 | s634393307 | Accepted | a,b,t = map(int,input().split())
print((t//a)*b) |
p02729 | s100598900 | Accepted | def odd_even():
N,M = map(int, input().split())
return N*(N-1)//2 + M*(M-1)//2
print(odd_even()) |
p03759 | s100171223 | Accepted | # -*- coding: utf-8 -*-
a, b, c = map(int,input().split())
if b - a == c - b:
print("YES")
else:
print("NO")
|
p03862 | s527924807 | Accepted | n, x = map(int, input().split())
a = [0] + list(map(int, input().split()))
ans = 0
for i in range(n):
if a[i] + a[i+1] > x:
diff = (a[i] + a[i+1]) - x
ans += diff
a[i+1] -= diff
print(ans)
|
p03221 | s574560503 | Accepted | from collections import defaultdict
p_y = defaultdict(set)
N,M = map(int,input().split())
PY = [[int(x) for x in input().split()] for _ in range(M)]
for p,y in PY:
p_y[p].add(y)
def set_rank(retu):
return {x:i for i,x in enumerate(sorted(retu), 1)}
p_y = {p:set_rank(retu) for p,retu in p_y.items()}
for p,y in PY:
print('{:06g}{:06g}'.format(p,p_y[p][y])) |
p02720 | s180814626 | Accepted | from collections import deque
def solve():
K = int(input())
q = deque(list(range(1,10)))
cnt = 0
tmp = 0
while cnt < K:
tmp = q.popleft()
cnt += 1
ones_place = tmp % 10
if ones_place != 0:
q.append(tmp*10+ones_place-1)
q.append(tmp*10+ones_place)
if ones_place != 9:
q.append(tmp*10+ones_place+1)
print(tmp)
if __name__ == '__main__':
solve() |
p02727 | s129692964 | Wrong Answer | x, y, a, b, c = map(int, input().split())
arrayP = list(input().split())
arrayQ = list(input().split())
arrayR = list(input().split())
arrayP.sort(reverse=True)
arrayQ.sort(reverse=True)
arrayR.sort(reverse=True)
arrayAns = []
for i in range(x):
arrayAns.append(int(arrayP[i]))
for i in range(y):
arrayAns.append(int(arrayQ[i]))
arrayAns.sort()
for i in range(len(arrayR)):
if arrayAns[0] <= int(arrayR[i]):
arrayAns[0] = int(arrayR[i])
arrayAns.sort()
print(sum(arrayAns)) |
p02548 | s040601281 | Accepted | n=int(input())
sm=0
for i in range(1,n):
sm+=(n-1)//i
print(sm)
|
p03126 | s713964151 | Wrong Answer | N,M=map(int,input().split())
A=list(map(int,input().split()))
A.pop(0)
if N>1:
for _ in range(N-1):
B=list(map(int,input().split()))
for num in A:
if num not in B[1:]:
A.remove(num)
print(len(A)) |
p02818 | s697600197 | Accepted | import sys
input = sys.stdin.readline
a,b,k = (int(x) for x in input().split())
if a>k:
print(a-k,b)
elif a+b>k:
print(0,a+b-k)
else:
print(0,0)
|
p02572 | s944909578 | Wrong Answer | N = int(input())
A = [int(e) for e in input().split()]
S = [0]
sum =0
for i in range(0, N):
S.append(S[i] + A[i])
for i in range(N):
sum = sum + (S[i+1]-A[i]) * A[i]
print(sum)
|
p02820 | s100733064 | Accepted | N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = [_ for _ in input()]
cnt = 0
for i in range(N):
if i < K or T[i] != T[i-K]:
if T[i] == "r":
cnt += P
elif T[i] == "s":
cnt += R
else:
cnt += S
else:
T[i] = "z"
print(cnt) |
p02683 | s680703061 | Wrong Answer | N, M, X= map(int, input().split())
arr=[list(map(int, input().split())) for _ in range(N)]
ans=1e+15
for paint_h in range(2**N):
temp_arr=[0]*M
for i in range(N):
if (paint_h>>i)&1==1:
temp_arr=[a+b for (a, b) in zip(temp_arr, arr[i])]
if all(i>=X for i in temp_arr[1:]):
ans=min(ans, temp_arr[0])
if ans==1e+15:
ans=-1
print(ans) |
p03324 | s393061354 | Accepted | a, b = map(int, raw_input().split())
ans = 1
for i in range(a):
ans = ans * 100
if b == 100:
print ans * 101
else:
print ans * b |
p02912 | s997180901 | Accepted | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
n,m = list(map(int, input().split()))
a = list(map(int, input().split()))
from heapq import heappop as hpp, heappush as hp
h = []
for num in a:
hp(h, -num)
for _ in range(m):
val = hpp(h)
val *= -1
hp(h, -(val//2))
ans = -sum(h)
print(ans) |
p03997 | s830888096 | Wrong Answer | a=int(input())
b=int(input())
h=int(input())
print((a+b)*h/2) |
p02595 | s273623996 | Wrong Answer | import math
n, d = map(int, input().split())
cnt = 0
for i in range(n):
x, y = map(int, input().split())
dist = math.sqrt((x * x) + (y * y))
print(dist)
if dist <= d:
cnt += 1
print(cnt)
|
p03042 | s241197264 | Accepted | def f(s):
m,y = int(s[:2]), int(s[2:])
return (0 < m <= 12,0 < y <= 12)
print {(0,0):'NA', (0,1): 'YYMM', (1,0): 'MMYY', (1,1):'AMBIGUOUS'}[tuple(map(int,list(f(raw_input()))))]
|
p02813 | s931354362 | Wrong Answer | n = int(input())
a = tuple(map(int,input().split()))
b = tuple(map(int,input().split()))
l = tuple(x+1 for x in range(n))
#print(a,b,l)
c,d = 0,0
cnt = 0
from itertools import permutations
for k in permutations(l):
#print(k)
cnt += 1
if a ==k:
c = cnt
elif b ==k:
d = cnt
print(abs(c-d)) |
p03261 | s336313238 | Accepted | N = int(input())
m = dict()
prev = input()
m[prev] = True
flg = True
for _ in range(N - 1):
s = input()
flg = all([flg, s not in m, prev[len(prev) - 1] == s[0]])
m[s] = True
prev = s
print("Yes" if flg else "No") |
p03773 | s217123649 | Wrong Answer | a, b = map(int, input().split())
if a+b<=24:
print(a+b)
else:
print(a+b-12) |
p02759 | s225200521 | Wrong Answer | i = int(input())
j= i/2
k= i/2 +1
if (i== k or i==j):
print(int(j)) |
p03076 | s107607317 | Wrong Answer | import math
A = [int(input()) for _ in range(5)]
B = 10
ans = 0
for i in range(5):
if A[i] % 10 < B and A[i] > 0:
B = A[i] % 10
ans = -10+B
for j in A:
ans += math.ceil(j)
print(ans) |
p03962 | s262466901 | Accepted | print(len(set(input().split())))
|
p03243 | s689741665 | Accepted | N = int(input())
for n in range(N, 1000):
if len(set(str(n))) == 1:
print(n)
break |
p02723 | s110429872 | Accepted | s=input()
if s[2]==s[3] and s[4]==s[5]:
print("Yes")
else:
print("No") |
p03338 | s702051095 | Wrong Answer | N,S=int(input()),input()
ans=0
for i in range(N):
a,b,c=S[:i+1],S[i:],0
for j in range(26):
if chr(97+j)in a and chr(97+j)in b:c+=1
ans=max(ans,c)
print(ans) |
p03013 | s302557445 | Wrong Answer | import sys
def fb(num):
a, b = 1, 0
for _ in range(num):
a, b = a + b, a
return b
n,m = map(int,input().split())
broken = []
for i in range(m):
broken.append(int(input()))
if(len(broken) >= 2):
if(broken[i] - broken[i-1] == 1):
print("0")
sys.exit()
ans = fb(n)//(2**m) % 1000000007
print(ans) |
p03262 | s176001281 | Wrong Answer | n, X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)
y = [x[i+1]-x[i] for i in range(n)]
def eu(a, b):
a, b = sorted([a,b])
while a != 0:
b, a = a, b%a
return b
d = y[0]
for i in range(1, n-1):
d = eu(d, y[i])
print(d) |
p02732 | s440651808 | Wrong Answer | N = int(input())
d = {}
for i in range(1,N+1):
d[i] = 0
A = list(map(int,input().split()))
for i in range(N):
a = A[i]
d[a] += 1
s = 0
for i in range(1,N+1):
x = d[a]
s += (x*(x-1))//2
for i in range(N):
y = A[i]
z = s + 1 - d[y]
print(z) |
p03419 | s683083508 | Accepted | def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n,m = iim()
if n == 1 or m == 1:
if n*m == 1:
print(1)
else:
print(n*m-2)
else:
print((n-2)*(m-2)) |
p03723 | s012708150 | Accepted | def solve(a, b, c):
if any(i % 2 == 1 for i in [a, b, c]):
return 0
if a == b == c:
return -1
a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
return solve(a, b, c) + 1
a, b, c = map(int, input().split())
print(solve(a, b, c)) |
p02897 | s579874058 | Accepted | import numpy as np
N = int(input())
l = np.arange(1,N+1)
print(np.sum(l%2==1)/N)
|
p03360 | s973736784 | Accepted | a = list(map(int, input().split()))
k = int(input())
n = sum(sorted(a)[:-1])
s = sorted(a)[-1]
for i in range(k):
s = s * 2
print(n + s) |
p03435 | s902697103 | Accepted | c11, c12, c13 = map(int, input().split())
for i in range(2):
c1, c2, c3 = map(int, input().split())
if (c1-c11) == (c2-c12) and (c2-c12) == (c3-c13):
c11, c12, c13 = c1, c2, c3
else:
print('No')
exit()
print('Yes') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.