problem_id stringclasses 428 values | submission_id stringlengths 10 10 | status stringclasses 2 values | code stringlengths 5 816 |
|---|---|---|---|
p03239 | s203492744 | Wrong Answer | N, T = map(int, input().split())
lists = [list(map(int, input().split())) for i in range(N)]
cost = 0
count = 0
for i in range(N):
if lists[i][1] <= T:
if i == 0:
cost = lists[i][0]
count += 1
elif cost > lists[i][0]:
cost = lists[i][0]
count += 1
else:
count += 1
continue
else:
continue
if count == 0:
print("TLE")
else:
print(cost) |
p03695 | s841514726 | Accepted | import sys
sys.setrecursionlimit(10**7)
mo=10**9+7
n=int(input())
a=[0]*9
for s in map(int,input().split()):
for i in range(8):
if int(s)>=i*400 and (i+1)*400>int(s):
a[i]=1
if int(s)>=3200:
#print(int(s),'rain')
a[8]+=1
#print(a)
ans=sum(a[0:8])
#ans=[ans,min(8,a[8]+ans)]
ans=[max(1,ans),a[8]+ans]
print(*ans)
|
p02600 | s382683818 | Wrong Answer | w = 199
x = int(input())
if x >= 400 and x < 600:
print(8)
elif x >= 600 and x < 800:
print(7)
elif x >= 800 and x < 1000:
print(6)
elif x >= 1000 and x < 1200:
print(5)
elif x >= 1200 and x < 1400:
print(4)
elif x >= 1400 and x < 1600:
print(3)
elif x >= 1600 and x < 1800:
print(1)
elif x >= 1800 and x < 2000:
print(1)
|
p02676 | s436970593 | Wrong Answer | import sys
count = 0
for i in sys.stdin:
if count == 0:
K = int(i)
count += 1
else:
S = i
length = len(S)
if length <= K:
print(S)
else:
S_ = S[:K]+"..."
print(S_)
|
p02814 | s494934532 | Accepted | from fractions import gcd
n, m = map(int, input().split())
aa = list(map(int, input().split()))
lcm = 1
def p2(m):
cnt = 0
n = m
while 1:
if n%2 == 0:
cnt += 1
n = n//2
else:
break
return cnt
pp = p2(aa[0])
for a in aa:
lcm = a * lcm // gcd(a, lcm)
if pp != p2(a):
lcm = 10 **18
break
tmp = lcm // 2
print((m // tmp + 1) // 2) |
p02953 | s176729468 | Wrong Answer | n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
if h[i]>h[i+1]:
h[i]-=1
print('Yes' if h==sorted(h) else 'No') |
p02578 | s887958247 | Wrong Answer |
n = int(input())
a = list(map(int,input().split()))
m = max(a)
s = 0
ind = a.index(m)
for i in range(n):
if i == n-1:
break
else:
if a[i]>a[i+1] and i < ind:
s += a[i]-a[i+1]
else:
a[i]>a[i+1]
s += a[ind]-a[i+1]
print(s) |
p02639 | s586760736 | Accepted | x1, x2, x3, x4, x5= map(int, input().split())
if x1==0:
print("1")
elif x2 == 0:
print("2")
elif x3 == 0:
print("3")
elif x4 ==0:
print("4")
elif x5 == 0:
print("5") |
p02646 | s494745643 | Accepted | a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if abs(b - a) <= (v - w) * t:
print("YES")
else:
print("NO")
|
p03785 | s449563604 | Accepted | import bisect
import sys
def input(): return sys.stdin.readline().strip()
N, C, K = map(int, input().split())
T = sorted([int(input()) for i in range(N)])
TT = [i + K for i in T]
cnt = 0
i = 0
temp = -1 # temp番まで運び終わった
while True:
i = bisect.bisect_right(T, TT[i])
if i - temp > C:
i = temp + C + 1
temp += C
cnt += 1
temp = i - 1
if i >= N:
break
print(cnt) |
p02772 | s778601778 | Accepted | n = int(input())
a = list(map(int,input().split()))
for i in range(n):
if a[i]%2==1:
pass
else:
if a[i]%3 !=0 and a[i]%5 !=0:
print('DENIED')
exit(0)
else:
pass
print("APPROVED") |
p03319 | s125529353 | Wrong Answer | from math import ceil
def myAnswer(N:int,K:int,A:list) -> int:
if(N == K): return 1
total = K *ceil(N/K) - ceil(N/K)
ans = ceil(N/K)
if(total < N):
ans += 1
return ans
def modelAnswer():
return
def main():
N,K = map(int,input().split())
A = list(map(int,input().split()))
print(myAnswer(N,K,A[:]))
if __name__ == '__main__':
main() |
p02697 | s533558522 | Accepted | n,m=map(int,input().split())
if n %2 == 1:
for i in range(1,m+1):
print(i,n-i)
else:
for i in range(m//2):
print(n//2-i,n//2+1+i)
print(i+1,n-i-1)
if m%2 == 1:
print(n//2-m//2,n//2+1+m//2)
|
p02862 | s594015544 | Accepted | def nck(n, k):
numer, denom = 1, 1
for i in range(k):
numer = numer * (n-i) % MOD
denom = denom * (k-i) % MOD
return numer * pow(denom, MOD-2, MOD) % MOD
x, y = map(int, input().split())
MOD = 10 ** 9 + 7
i = 2 * y - x
j = 2 * x - y
if i % 3 != 0 or j % 3 != 0 or i < 0 or j < 0:
print(0)
else:
i, j = i // 3, j // 3
print(nck(i+j, min(i, j)))
|
p03681 | s307534344 | Accepted | n,m=map(int,input().split())
mod=10**9+7
def kaijou(x):
y=1
for i in range(1,x+1):
y*=i
y%=mod
return y
if abs(n-m)>=2:
print(0)
elif n==m:
print((kaijou(n)*kaijou(m)*2)%mod)
else:
print((kaijou(n)*kaijou(m))%mod)
|
p04029 | s381449550 | Accepted | sum = 0
for i in range(1,int(input())+1):
sum += i
print(sum) |
p02829 | s338218577 | Wrong Answer | a=int(input())
b=int(input())
l=[1,2,3]
index_a=l.index(a)
index_b=l.index(b)
x=l.index(a,b not in l)
print(l[x]) |
p03435 | s502173953 | Accepted | c = []
for _ in range(3):
c.append(list(map(int, input().split())))
j1 = c[0][0] - c[0][1]
j2 = c[0][1] - c[0][2]
for i in range(1, 3):
_j1 = c[i][0] - c[i][1]
_j2 = c[i][1] - c[i][2]
if j1 == _j1 and j2 == _j2:
continue
print("No")
break
else:
print("Yes") |
p03705 | s021211291 | Wrong Answer | import sys
input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def main():
mod=10**9+7
N,A,B=MI()
ans=0
rem=N-2
ans=rem*(B-A)+1
ans=max(ans,0)
if A>B or rem<0:
ans=0
print(ans)
main()
|
p03836 | s071214415 | Accepted | sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy
ans="R"*x+"U"*y
ans+="L"*x+"D"*y
x+=1
y+=1
ans+="L"+"U"*y+"R"*x+"D"
ans+="R"+"D"*y+"L"*x+"U"
print(ans) |
p03076 | s852709300 | Accepted | import numpy as np
l = [int(input()) for _ in range(5)]
n = np.array(l)
n = 1000 - n
n %= 10
idx = np.argsort(n)
t = 0
for i in idx[:-1]:
t += l[i]
if(n[i] != 0):
t = (t+10)-t%10
t += l[idx[-1]]
print(t) |
p03146 | s939195308 | Accepted | s=int(input())
L=[]
n=1
while not s in L:
L.append(s)
if s%2==0:
s//=2
else:
s=s*3+1
n+=1
print(n) |
p02973 | s612366551 | Wrong Answer | n = int(input())
colors = []
for i in range(n):
a = int(input())
if i == 0:
colors.append(a)
continue
if a <= colors[-1]:
colors.append(a)
elif a > colors[0]:
colors[0] = a
else:
l, r = 0, len(colors)
while r-l > 1:
k = (r+l)//2
if colors[k] >= a:
r = k
else:
l = k
if colors[l] < a:
colors[l] = a
else:
colors[r] = a
print(len(colors)) |
p02848 | s447381016 | Wrong Answer | N=int(input())
S=input()
s=list()
for i in S:
temp=ord(i)+2
if temp<=ord("Z"):
s.append(chr(temp))
else:
s.append(chr(temp-(ord("Z")-ord("A"))-1))
for i in s:
print(i,end="")
|
p02701 | s548730097 | Wrong Answer | a = input()
a = int(a)
c= []
for i in range(a):
b = input()
c.append(b)
c = list(set(c))
#print(c)
len(c) |
p03386 | s320323087 | Accepted | # solution
import io
n,m,k = map(int,input().split())
if 2*k >= m-n+1:
for i in range(n,m+1):
print(i)
else:
for j in range(n,n+k):
print(j)
for p in range(m-k+1,m+1):
print(p) |
p02661 | s476059283 | Accepted | N=int(input())
A=[0]*N
B=[0]*N
for i in range(N):
A[i], B[i]=map(int, input().split())
A.sort()
B.sort()
if N%2==1:
print(B[N//2]-A[N//2]+1)
else:
print(B[N//2]+B[N//2-1]-A[N//2]-A[N//2-1]+1) |
p02756 | s098682134 | Accepted | from collections import deque
string = input()
x = deque()
for s in string:
x.append(s)
head_left = True
B = int(input())
for i in range(B):
cmd = input().split()
if len(cmd) == 1 and cmd[0] == "1":
head_left = not head_left
else:
_, n, c = cmd
if (n == "1" and head_left) or (n == "2" and not head_left):
x.appendleft(c)
else:
x.append(c)
if head_left:
print("".join(list(x)))
else:
print("".join(reversed(list(x)))) |
p02771 | s270412188 | Accepted | A = list(map(int, input().split()))
if len(set(A)) == 2:
print('Yes')
else: print('No') |
p03073 | s000713448 | Accepted | S = list(input())
lenS = len(S)
patternA = []
patternB = []
countA = 0
countB = 0
for x in range(lenS):
if x % 2 == 0:
if S[x] == "0":
countA += 1
else:
countB += 1
else:
if S[x] == "1":
countA += 1
else:
countB += 1
if countA < countB:
print(countA)
else:
print(countB)
|
p03327 | s769900159 | Wrong Answer | N = int(input())
if N <= 999:
s = 'ABC' + str(N).zfill(3)
else:
s = 'ABD' + str(N-999).zfill(3)
print(s) |
p02621 | s007153602 | Wrong Answer | n=int(input("enter no"))
print(n+n*n+n*n*n) |
p03494 | s535950716 | Wrong Answer | n = int(input())
a = list(map(int, input().split()))
mod = [0]*n
check = 0
for ii in range(1000):
for i in range(n):
mod[i] = a[i] % 2
check = check + mod[i]
a[i] = a[i]/2
if (check==1):
print(ii)
break |
p03345 | s198351937 | Accepted | a, b, c, k = map(int, input().split())
if k % 2 == 0:
print(a - b)
else:
print(b - a)
|
p02796 | s495294663 | Accepted | n = int(input())
a = sorted((tuple(map(int, input().split())) for _ in range(n)), key=sum)
r = 0
p = -10**9
for x, l in a:
if x - l >= p:
r += 1
p = x + l
print(r)
|
p02731 | s068917813 | Accepted | L = int(input())
print((L/3)**3) |
p02646 | s796317121 | Wrong Answer | a, v = map(int,input().split())
b, w = map(int,input().split())
t = int(input())
if b > a:
if b - a <= (v-w) * t:
print('YES')
else :
print('NO')
if b < a:
if a - b <= (w-v)*t:
print('YES')
else:
print('NO') |
p03971 | s300918077 | Accepted | n, a, b = map(int, input().split())
s = input()
ab = a + b
cnt = 0
fcnt = 1
for i in range(n):
if s[i] == 'a' and ab > cnt:
cnt += 1
print('Yes')
elif s[i] == 'b' and (ab > cnt and b >= fcnt):
cnt += 1
fcnt += 1
print('Yes')
else:
print('No') |
p02753 | s842288481 | Accepted | S = set(list(str(input())))
if len(S) == 1:
print("No")
else:
print("Yes") |
p03705 | s540386623 | Wrong Answer | n, a, b = map(int, input().split())
print((b - a) * (n - 2) + 1)
|
p02663 | s945323304 | Accepted | H_1,M_1,H_2,M_2,K=input().split()
H_1=int(H_1)
M_1=int(M_1)
H_2=int(H_2)
M_2=int(M_2)
K=int(K)
H1=H_1*60+M_1
H2=H_2*60+M_2
answer=H2-H1-K
print(answer) |
p02702 | s939834781 | Wrong Answer | S = input()
n = len(S)
count = 0
if(n>3):
for i in range(n-3):
num = int(S[i:i+4])
if num%2019==0:
count += 1
print(count)
|
p02730 | s181755565 | Wrong Answer | s = input()
s = [c for c in s]
left = s[:len(s)//2]
right = s[len(s)//2+1:]
def check(s):
left = []
right = []
while len(s)>1:
left.append(s.pop(0))
right.append(s.pop())
if left==right:
return True
else:
return False
if check(left)==True and check(right)==True and left==right:
print('Yes')
else:
print('No') |
p03543 | s830959003 | Accepted | a = input()
b = a[0]+a[0]+a[0]
c = a[1]+a[1]+a[1]
if (b in a) or (c in a):
print("Yes")
else:
print("No") |
p03494 | s421254070 | Wrong Answer | N=input()
ls=list(map(int,input().split()))
ans=0
flag=0
while flag==1:
for elem in range(N):
if ls[elem]%2:
ls[elem]=ls[elem]/2
else:
flag=1
ans+=1
print(ans) |
p02797 | s988566347 | Wrong Answer | # coding: utf-8
N, K, S = map(int, input().split())
L = []
for i in range(N):
if i < K:
L.append(S)
else:
L.append(S*2)
print(*L) |
p02724 | s274815952 | Accepted | x=int(input())
a=x//500
b=(x%500)//5
print(a*1000 + b*5) |
p02602 | s211697482 | Accepted | n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k):
print('Yes' if a[i]<a[i+k] else 'No')
|
p02629 | s740717385 | Wrong Answer | import string
lower = string.ascii_lowercase
N_org = int(input())
N_order = 0
N=N_org
while N > 0:
if N //len(lower) >=1:
N = N//len(lower)
N_order = N_order+1
else:
break;
S = ""
N= N_org
for i in range(N_order,0,-1):
syou = N//(len(lower)**i)
moji = lower[syou-1]
N = N%(len(lower)**i)
S = S + moji
S = S+ lower[N%len(lower)-1]
print(S) |
p02608 | s486111394 | Wrong Answer | n = int(input())
for i in range(1,n+1):
cnt = 0
for x in range(1,14):
for y in range(1,14):
for z in range(1,14):
if x**2 + y**2 + z**2 + (x*(y+z)) + (y*z) == i:
cnt += 1
print(cnt)
|
p03408 | s106366533 | Accepted | from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
M = int(input())
T = [input() for _ in range(M)]
S_cnt = Counter(S)
S_key = S_cnt.keys()
T_cnt = Counter(T)
for key,v in T_cnt.items():
if not key in S_key:
continue
S_cnt[key] -= v
print(max(max(S_cnt.values()), 0)) |
p03469 | s801257581 | Accepted | date = input()
print(date.replace("2017","2018")) |
p03145 | s870689144 | Accepted | x = input()
a, b, c = [int(i) for i in x.split()]
print(int((a*b)/2))
|
p03103 | s369123459 | Wrong Answer | n,m=map(int,input().split())
array=[]
cost=0
for i in range(n):
a,b=map(int,input().split())
array.append([a,b])
array.sort()
for i in array:
if m<=i[1]:
cost+=i[0]*m
else:
cost+=i[0]*i[1]
m-=i[1]
print(cost) |
p02862 | s316417810 | Accepted | mod = 10**9 + 7
def cmb(n,r,mod):
a=1
b=1
r = min(r,n-r)
for i in range(r):
a = a*(n-i)%mod
b = b*(i+1)%mod
return a*pow(b,mod-2,mod)%mod
X,Y = map(int,input().split())
if (X+Y)%3 != 0:
ans = 0
else:
n = (2*X-Y)//3
m = (2*Y-X)//3
if n < 0 or m < 0:
ans = 0
else:
ans = cmb(n+m,m,mod)
print(ans) |
p03494 | s566681894 | Accepted | from math import gcd
N = int(input())
A = list(map(int, input().split()))
g = A[0]
for i in range(1, N):
g = gcd(g, A[i])
ans = 0
while g % 2 == 0:
g //= 2
ans += 1
print(ans) |
p03838 | s829322589 | Accepted | x, y = map(int, input().split())
ans = []
if y-x>=0:
ans.append(y-x)
if -y-x>=0:
ans.append(-y-x+1)
if y+x>=0:
ans.append(y+x+1)
if -y+x>=0:
ans.append(-y+x+2)
print(min(ans))
|
p03548 | s526876453 | Accepted | X, Y, Z = map(int, input().split())
print((X-Z)//(Y+Z))
|
p02627 | s493884198 | Wrong Answer | a = input()
print(a.swapcase()) |
p03605 | s941017881 | Wrong Answer | N = input()
if "9" in "N":
print("YES")
else:
print("NO") |
p02603 | s511936572 | Accepted | n = int(input())
a = list(map(int, input().split()))
money = 1000
num = 0
flag = False
a.append(a[n - 1])
for i in range(n):
#print(num, money)
if a[i] < a[i + 1]:
num += money // a[i]
money -= a[i] * num
money += num * a[i + 1]
num = 0
print(money) |
p03329 | s998455423 | Accepted | N = int(input())
INF = 10 ** 9
def base(x, y):
ret = 0
while x >= y:
ret += x % y
x //= y
ret += x
return ret
def main():
ans = INF
for i in range(N + 1):
v = base(i, 6) + base(N - i, 9)
ans = min(ans, v)
print(ans)
if __name__ == "__main__":
main()
|
p03632 | s312111237 | Wrong Answer | A=list(map(int,input().split()))
list=[0]*101
#A~B秒までの要素を+1
for i in range(A[0],A[1]+1):
list[i]+=1
for i in range(A[2],A[3]+1):
list[i]+=1
print(list.count(2)) |
p02935 | s565278635 | Wrong Answer | N = int(input())
v = sorted(list(map(int,input().split())))
ans = []
#print((sum(v[:-1])/(N-1)+v[-1])/2)
for i in range(1,N):
v[i-1]=(v[i-1]+v[i])/2
print(min(v))
|
p03282 | s842812232 | Accepted | S = input()
K = int(input())
for i, s in enumerate(S):
if s != '1':
print(s)
break
if i + 1 == K:
print('1')
break
|
p03131 | s003991665 | Accepted | k,a,b = map(int,input().split())
if b<=a+1:
print(1+k)
else:
n = (k-a+1)//2
m = (k-a+1)%2
print(n*(b-a)+m+a) |
p03817 | s896697105 | Accepted | x=int(input())
a=x//11
p,q=divmod(x,11)
if q==0:
print(p*2)
elif q<=6:
print(p*2+1)
else:
print(p*2+2) |
p03285 | s032963647 | Wrong Answer | n = int(input())
a = n // 4
b = n // 7
count = 0
for i in range(a):
n = n - i * 4
for j in range(b):
if n % 7 == 0:
print("Yes")
count += 1
break
else:
pass
if count == 0:
print("No")
else:
pass |
p03417 | s617502760 | Accepted | N, M = map(int, input().split())
if N > M:
N, M = M, N
if N == 1:
if M == 1:
print(1)
exit()
else:
M -= 2
else:
N -= 2
M -= 2
print(N * M)
|
p02768 | s096679687 | Wrong Answer | n, a, b = map(int, input().split())
mod = 10 ** 9 + 7
def comb(n, r):
res = 1
for i in range(1, r+1):
res = res*(n-i+1) % mod
res = res*pow(i, mod-2, mod) % mod
return res
ans = (pow(2, n, mod)-1) - comb(n, a) % mod - comb(n, b) % mod
print(ans)
|
p02663 | s764596147 | Accepted | H1, M1, H2, M2, K = map(int,input().split())
T = (H2 - H1)*60 + (M2 - M1) - K
if T <= 0:
print(0)
else:
print(T)
|
p02640 | s683754806 | Wrong Answer | X,Y=map(int,input().split())
a = 2*X -Y/2
b = Y/2 - X
if ((a+b) == X) and ((2*a+4*b) == Y):
print('Yes')
elif ((a+b) not in X) and ((2*a+4*b) not in Y):
print('No') |
p02820 | s523684091 | Wrong Answer | N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = [i for i in input()]
x = T[0]
ans = 0
for i in range(1,N):
y = T[i]
if x != y:
if y == "s":
ans += R
elif y == "p":
ans += S
else:
ans += P
x = y
#print(ans,i)
print(ans) |
p02629 | s695627917 | Accepted | n = int(input())
tmp = n
ans = ""
i = 1
while n > 0:
n -= 1
r = n % 26
ans += chr(ord("a") + r)
n = n // 26
print(ans[::-1]) |
p02882 | s454511156 | Accepted | import math
pi=math.pi
def rtod(rad):
return 180/pi*rad
a,b,x=map(int,input().split())
if b/2<x/a**2:
ans=2*(a**2*b-x)/a**3
ans=math.atan(ans)
print(rtod(ans))
else:
ans=b**2/(2*x)*a
ans=math.atan(ans)
print(rtod(ans))
|
p03493 | s016474709 | Wrong Answer | li = input().split()
print(li.count("1"))
|
p03720 | s999992256 | Accepted | n,m = map(int,input().split())
ans = [0]*100
for i in range(m):
a,b = map(int,input().split())
ans[a-1] += 1
ans[b-1] += 1
for i in range(n):
print(ans[i]) |
p02744 | s645800344 | Accepted | N = int(input())
inp = 'a'
def AAA(arr):
if len(arr) < N:
for i in range(ord(max(arr))-96+1):
AAA(arr+chr(i+1+96))
else:
print(arr)
AAA(inp) |
p02910 | s628885874 | Wrong Answer | N = str(input())
c = []
for i in range(0,len(N)-1):
if i % 2 == 0:
if N[i] == 'R' or N[i] == 'U' or N[i] == 'D':
c.append(N[i])
else:
if N[i] =='L' or N[i] == 'U' or N[i] == 'D':
c.append(N[i])
if len(c) == len(N):
print('Yes')
else:
print('No') |
p03380 | s162252239 | Accepted | import bisect
import math
N = int(input())
As = list(map(int, input().split()))
As.sort()
a = As[-1]
j = bisect.bisect_left(As, a/2)
if j == 0 or a - As[j] > As[j-1]:
print("{} {}".format(a, As[j]))
else:
print("{} {}".format(a, As[j-1])) |
p02777 | s798844419 | Wrong Answer | S = input()
l = len(S)
K = ""
for i in range(l):
K += "x"
print(K) |
p02612 | s824853470 | Accepted | N=int(input())%1000
if N==0:
print(0)
else:
print(1000-N) |
p02714 | s917244736 | Accepted | n = int(input())
s = input()
r = g = b = 0
for i in s:
if i == "R":
r += 1
elif i == "G":
g += 1
elif i == "B":
b += 1
ans = r * g * b
for i in range(n-2):
si = s[i]
for j in range(i+1, i+(n-i-1)//2+1):
sj = s[j]
k = 2*j-i
if k < n and s[k] != si and s[k] != sj and si != sj:
ans -= 1
print(ans) |
p02859 | s137334978 | Accepted | r= int(input())
print(r**2) |
p03997 | s625788277 | Accepted | a=int(input())
b=int(input())
h=int(input())
print(int((a+b)*h/2)) |
p03545 | s185826145 | Accepted | from itertools import product
ABCD = input()
for op in product(("+", "-"), repeat=3):
ans = ""
for i in range(len(ABCD)-1):
ans += ABCD[i] + op[i]
ans += ABCD[-1]
if eval(ans) == 7:
print(ans+"=7")
exit() |
p02693 | s531229245 | Accepted | K = int(input())
A, B = map(int, input().split())
flg = False
for i in range(A, B+1):
if i % K == 0:
flg = True
break
if flg:
print('OK')
else:
print('NG') |
p03861 | s233411940 | Accepted | a,b,x=map(int,input().split())
num_a=a//x
num_b=b//x
ans=num_b-num_a
if a%x==0:
ans+=1
print(ans) |
p02730 | s909031260 | Accepted | s = input()
ss = s[:len(s) // 2]
ans = "Yes"
if s != s[::-1] or ss != ss[::-1]: ans = "No"
print(ans)
|
p03767 | s294288194 | Accepted | N = int(input())
a = list(map(int, input().split()))
l = len(a)
a.sort(reverse=True)
ans = 0
cnt = 0
for i in range(1,l,2):
ans += a[i]
cnt += 1
if cnt == N: break
print(ans) |
p03474 | s621132329 | Accepted | a,b=map(int,input().split())
s=input()
flag1=True
if s[a]!='-':
flag1=False
flag2=True
for i in range(0,len(s)):
if i==a:
continue
if not (s[i]>='0' and s[i]<='9'):
flag2=False
print('Yes') if flag1 and flag2 else print('No')
|
p02766 | s796572767 | Wrong Answer | import math
x,y = map(int ,input().split())
m = math.ceil(math.log(x, y))
print(m)
|
p02618 | s994515289 | Accepted | #!/usr/bin/env python3
n = int(input())
c = list(map(int, input().split()))
for _ in range(n):
s = list(map(int, input().split()))
a = max(enumerate(s), key=lambda x: x[1])[0] + 1
print(a)
|
p03126 | s132505406 | Wrong Answer | import math
import string
def readints():
return list(map(int, input().split()))
def nCr(n, r):
return math.factorial(n)//math.factorial(n-r)*math.factorial(r)
n, m = map(int, input().split())
s = set(range(1, m+1))
# print(s)
for i in range(n):
a = list(map(int, input().split()))
a_set = set(a[1:])
# print(a_set)
s &= a_set
# print(s)
print(len(s))
|
p03557 | s316127321 | Accepted | import bisect
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
ans = 0
for i in b:
p = bisect.bisect_left(a, i)
q = bisect.bisect_right(c, i)
ans += (p*(n-q))
print(ans) |
p03457 | s029067958 | Accepted | N=int(input())
t=[0]*100003
x=[0]*100003
y=[0]*100003
for i in range(1,N+1):
t[i],x[i],y[i]=map(int, input().split())
count=0
for i in range(1,N+1):
dt=t[i]-t[i-1]
dist=abs(x[i]-x[i-1])+abs(y[i]-y[i-1])
if dist>dt:
break
else:
pass
if dist%2==dt%2:
pass
else:
break
count+=1
if count==N:
print('Yes')
else:
print('No') |
p03359 | s993690320 | Accepted | a,b = map(int, input().split())
print(a if a<= b else a-1)
|
p03623 | s328249426 | Accepted | # -*- coding: utf-8 -*-
x, a, b = map(int, input().split())
print('BA'[abs(a - x) < abs(b - x)]) |
p02690 | s203360037 | Accepted | import sys
x = int(input())
for i in range(-118, 120):
for j in range(-119, 119):
if i**5 - j**5 == x:
print(i, j)
sys.exit() |
p03760 | s822993525 | Accepted | O=input()
E=input()
for i in range(len(O)*2-1 if len(O)!=len(E) else len(O)*2):
if i%2==0:
print(O[i//2],end="")
else:
print(E[i//2],end="") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.