problem_id stringclasses 428 values | submission_id stringlengths 10 10 | status stringclasses 2 values | code stringlengths 5 816 |
|---|---|---|---|
p02607 | s500388210 | Wrong Answer | n =int(input())
li =list(map(int,input().split()))
count =0
for i in range(1,len(li),2):
if li[i] % 2 !=0:
count +=1
print(count) |
p02661 | s602126439 | Accepted | N = int(input())
As = []
Bs = []
for _ in range(N):
a,b = map(int,input().split())
As.append(a)
Bs.append(b)
As.sort()
Bs.sort()
if N%2 == 1:
ma = As[N//2]
mb = Bs[N//2]
print(mb-ma+1)
else:
ma = (As[N//2-1] + As[N//2])/2
mb = (Bs[N//2-1] + Bs[N//2])/2
print(int((mb-ma)*2)+1) |
p03261 | s347885150 | Accepted | def main():
N = int(input())
W_before = input()
W_list = set()
W_list.add(W_before)
for i in range(N-1):
W_after = input()
if W_before[-1] != W_after[0]:
print('No')
return
if W_after in W_list:
print('No')
return
W_list.add(W_after)
W_before = W_after
print('Yes')
if __name__ == "__main__":
main()
|
p02705 | s461531805 | Wrong Answer | import math
a = int(input())
print(a*math.pi) |
p02888 | s110462233 | Wrong Answer | n = int(input())
L = sorted(list(map(int, input().split())))
count = 0
i = n-1
for a in L[::-1]:
j = 0
for b, c in zip(L[:i-1], L[1:i]):
if a < b + c:
count += (i-j-1)*(i+j)//2
break
j += 1
i -= 1
print(count) |
p03210 | s881143182 | Accepted | year=int(input())
if year==3 or year==5 or year==7:
print("YES")
else:
print("NO")
|
p03835 | s840740340 | Accepted | # B - Sum of Three Integers
k,s = map(int,input().split())
c = 0
min_limit = s - k
for i in range(k+1):
for j in range(k+1):
if i + j <= s and i + j >= min_limit:
c += 1
print(c)
|
p02829 | s472381277 | Wrong Answer | a = int(input())
b = int(input())
if a == 1 and b == 2:
print(3)
elif a == 2 and b == 3:
print(1)
elif a == 3 and b == 1:
print(2) |
p03852 | s501855452 | Wrong Answer | c=str(input())
if c in "aiueo":
print("YES")
else:
print("NO") |
p03659 | s872926063 | Wrong Answer | n = int(input())
a = list(map(int,input().split()))
total = sum(a)
s = 0
i = 0
ans = total + 1
for i in range(n):
s += a[i]
total -= a[i]
ans = min(ans, abs(s - total))
i += 1
print(ans)
|
p03309 | s875754881 | Accepted | import statistics
N = int(input())
A = list(map(int,input().split()))
s = 0
X = []
for i in range(N):
A[i] -= i + 1
b = statistics.median(A)
for i in range(1,N+1):
s += abs(A[i-1] - int(b))
print(s)
|
p02594 | s780057385 | Accepted | n = int(input())
if n >= 30:
print("Yes")
else:
print("No") |
p03437 | s183738586 | Accepted | x,y=map(int,input().split())
print(x if x%y!=0 else -1) |
p02598 | s722048283 | Accepted | # E - Logs
import sys
sys.setrecursionlimit(1000000)
N,K = map(int,input().split())
A = list(map(int,input().split()))
def rec(l,r):
global N,K,A
if l==r:
return l
tmp = (l+r)//2
ans = 0
for i in range(N):
ans += (A[i]-0.001)//tmp
if ans<=K:
return rec(l,tmp)
else:
return rec(tmp+1,r)
print(rec(1,max(A))) |
p02939 | s386479375 | Accepted | S=input()
T=""
U=""
K=0
for s in S:
U+=s
if T!=U:
K+=1
T=U
U=""
print(K)
|
p02613 | s442943068 | Wrong Answer | n = int(input())
ac_c = 0
wa_c = 0
tle_c = 0
re_c = 0
for i in range(n):
s = input()
if s == "AC":
ac_c += 1
elif s == "WA":
wa_c += 1
elif s == "TLE":
tle_c += 1
else:
re_c +=1
print("AC" + "x" + str(ac_c))
print("WA" +"x"+ str(wa_c))
print("TLE"+ "x"+ str(tle_c))
print("RE" + "x"+ str(re_c))
|
p03804 | s476864658 | Wrong Answer | n,m = map(int,input().split())
a = []
b = []
for _ in range(n):
a.append(input())
for _ in range(m):
b.append(input())
for i in range(n-m+1):
if b[i] in a[i]:
for x in range(m-1):
if b[i+x] not in a[i+x]:
print("No")
exit()
else:
print("Yes")
exit()
else:
print("No")
exit() |
p03767 | s846646637 | Wrong Answer | # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1
N=int(input())
a=list(map(int,input().split()))
a.sort()
print(sum(a[N:2*N])) |
p02882 | s235452503 | Accepted | #!/usr/bin/env python3
import math
def main():
a, b, x = map(int, input().split())
if a * a * b / 2 <= x:
ans = math.atan(2 * (a * a * b - x) / (a * a * a))
else:
ans = math.pi / 2 - math.atan(2 * x / (a * b * b))
print(math.degrees(ans))
if __name__ == "__main__":
main()
|
p02706 | s132686409 | Accepted | d,n = map(int,input().split())
a = list(map(int,input().split()))
print(max(-1,d-sum(a))) |
p02659 | s064337410 | Accepted | import math
from decimal import Decimal
A,B=list(input().split())
A = Decimal(A)
B = Decimal(B)
# print(A* B)
print(int(A * B ))
|
p03672 | s342128631 | Wrong Answer | import numpy as np
S = str(input())
import numpy as np
for i in range(int(np.floor(len(S)/2))):
j = int(np.floor(len(S)/2)) - i
first_str = S[:j]
second_str = S[j:2*j]
if first_str == second_str:
num = 2*j
break
print(num) |
p02779 | s763669386 | Accepted | N = int(input())
A = []
A = input().split()
A = [int(i) for i in A]
#print('N = ', N)
#print('A = ', A)
A.sort()
#print('sortA = ', A)
count = 0
for i in range(N-1):
if A[i] == A[i+1]:
count += 1
break
if count > 0:
print('NO')
else:
print('YES')
|
p02900 | s654377336 | Accepted | import fractions
A,B = map(int,input().split())
def prime_factorize(n):
a = []
while n % 2 == 0:
a.append(2)
n //= 2
f = 3
while f * f <= n:
if n % f == 0:
a.append(f)
n //= f
else:
f += 2
if n != 1:
a.append(n)
return a
n = fractions.gcd(A,B)
print(len(set(prime_factorize(n)))+1) |
p03309 | s066792030 | Wrong Answer | N = int(input())
A_list = [int(item)-(index+1) for index, item in enumerate(input().split())]
b = sum(A_list)//len(A_list)
ans = 0
for i in A_list:
ans += abs(i-b)
print(ans) |
p02606 | s260774776 | Accepted | l,r,d=map(int,input().split())
cnt=0
for i in range(l,r+1):
if i%d==0:
cnt+=1
print(cnt) |
p02725 | s746529152 | Accepted | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
def main():
K, N = map(int, input().split())
A = list(map(int, input().split()))
va = np.array(A)
vb = np.array(A[1:] + [A[0] + K])
vv = vb - va
print(K - max(vv))
if __name__ == '__main__':
main() |
p02779 | s272415939 | Wrong Answer | n = int(input())
a = input().split(" ")
flag = False
for i in range(n-1):
for j in range(i, n):
if a[i] == a[j]:
Flag = True
break
if flag:
break
print('NO' if flag else 'YES')
|
p03779 | s398923065 | Accepted | x = int(input())
if x==1:
print(1)
else:
for i in range(2, x+1):
if i*(i-1)/2<x<=(i+1)*i/2:
print(i)
break
|
p02577 | s043033657 | Accepted | N = input()
ans = 0
for n in N:
ans += int(n)
ans %= 9
if ans % 9 == 0:
print('Yes')
else:
print('No')
|
p02933 | s926142244 | Accepted | a=int(input())
s=input()
if a>=3200:
print(s)
else:
print('red') |
p04020 | s240274307 | Accepted | import sys
N = int(sys.stdin.readline())
A = [int(sys.stdin.readline()) for _ in range(N)]
ans = 0
for i in range(1, N):
ans += (A[i - 1] + A[i]) >> 1
if A[i]:
A[i] = (A[i - 1] + A[i]) & 1
print(A[0] >> 1 if N == 1 else ans) |
p03854 | s730846647 | Wrong Answer | s = input()
u = ['dreamer', 'eraser', 'dream', 'erase']
while len(s) > 0:
for i in u:
if s[-len(i):-0] == i:
s = s.rstrip(i)
break
else:
print('No')
exit()
else:
print("YES") |
p02699 | s330785835 | Wrong Answer | animals = input()
S = animals[0]
W = animals[1]
if(W >= S): print('unsafe')
else: print('safe') |
p02982 | s145014002 | Wrong Answer | N, D = map(int, input().split())
zahyo = [0]*N
for i in range(N):
zahyo[i] = list(map(int, input().split()))
count = 0
for i in range(N):
for j in range(i+1, N):
V = 0
for k in range(D):
V += float((zahyo[i][k]-zahyo[j][k])**2)
if V.is_integer():
count += 1
print(count) |
p03433 | s933709855 | Accepted | import sys
a1 = []
for l in sys.stdin:
a1.append(int(l))
n , a = tuple(a1)
if n % 500 <= a:
print('Yes')
else:
print('No')
|
p02754 | s877636019 | Wrong Answer | import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()
def main():
N, A, B = MI()
if A != 0:
print(N-pow(10, 100, A+B))
else:
print(0)
if __name__ == '__main__':
main()
|
p03797 | s822669545 | Wrong Answer | n,m=[int(x) for x in input().rstrip().split()]
ans=0
m-=n*2
ans+=n
ans+=m//4
print(ans) |
p03761 | s492889413 | Accepted | import sys
input = sys.stdin.readline
N = int(input())
table = [0] * 26
mx = 0
a = ord("a")
for c in input()[: -1]:
table[ord(c) - a] += 1
#print(table)
for _ in range(N - 1):
s = list(input())[: -1]
for t in range(26):
table[t] = min(table[t], s.count(chr(t + a)))
res = []
for c in range(26):
if table[c]:
res += [chr(a + c)] * table[c]
print("".join(res)) |
p03293 | s809475198 | Accepted | s = input()
t = input()
ss = s+s
l = len(t)
for i in range(l):
if ss[i:i+l] == t:
print('Yes')
break
else:
print('No') |
p02973 | s969648330 | Accepted | import sys
input = sys.stdin.buffer.readline
from bisect import bisect_right
N = int(input())
li_a = []
for _ in range(N):
a = int(input())
li_a.append(a)
INF = 10**15
dp = [INF]* N
for i in range(N-1, -1, -1):
a = li_a[i]
k = bisect_right(dp, a)
dp[k] = a
check = INF-1
print(bisect_right(dp, check)) |
p03469 | s171536233 | Accepted | s=input()
print("2018"+s[4:]) |
p02948 | s447967528 | Accepted | import heapq
n, m = map(int, input().split())
pay = sorted([[-int(i) for i in input().split()] for _ in range(n)])
res = 0
pq = []
for i in range(1, m+1):
while pay and -pay[-1][0] <= i:
a, b = pay.pop()
heapq.heappush(pq, b)
if pq:
res -= heapq.heappop(pq)
print(res)
|
p02843 | s225253440 | Wrong Answer | x = int(input())
q = x // 100
r = x % 100
if 0 <= q and q <= 5*r:
print(1)
else:
print(0) |
p02607 | s971038014 | Wrong Answer | N = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(N):
if i%2 == 0:
continue
if a[i]%2 == 0:
continue
ans += 1
print(ans)
|
p02753 | s626091499 | Wrong Answer | a = input()
if a=="AAA" or "BBB":
print("No")
else:
print("Yes")
|
p03627 | s804026541 | Accepted | from collections import Counter
_, *lst = map(int, open(0).read().split())
c = Counter(lst).items()
stick2 = [i for i, j in c if j > 1]
stick4 = [0] + [i for i, j in c if j > 3]
max4 = max(stick4)
max4 *= max4
if len(stick2) > 1:
stick2.sort()
print(max(stick2[-1] * stick2[-2], max4))
else:
print(max(0, max4))
|
p02713 | s589453775 | Wrong Answer | def gcd2(a, b):
if b == 0:
return a
return gcd2(b, a % b)
def gcd3(a, b, c):
z = gcd2(a, b)
return(gcd2(c, z))
k = int(input())
t = 0
for a in range(1, k + 1):
for b in range(a, k + 1):
for c in range(b, k + 1):
t += gcd3(a, b, c)
print(t) |
p02631 | s249701866 | Accepted | def main():
N = int(input())
A = list(map(int, input().split()))
X = A[0]
for i in range(1, N):
X = X ^ A[i]
B = []
for v in A:
B.append(X ^ v)
print(" ".join(map(str, B)))
if __name__ == "__main__":
main() |
p04033 | s823360155 | Accepted | a,b = map(int,input().split())
if a>0:
print("Positive")
elif b >= 0 >= a:
print("Zero")
elif (b-a+1)%2==0:
print("Positive")
else:
print("Negative") |
p02917 | s162513382 | Accepted | N = int(input())
B = list(map(int, input().split()))
A = []
A.append(B[0])
for i in range(0, N-2):
if B[i] < B[i+1]:
A.append(B[i])
else:
A.append(B[i+1])
A.append(B[N-2])
print(sum(A)) |
p03067 | s964261141 | Accepted | import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce
rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7
a, b, c = rm()
if a<c<b or a>c>b:
print('Yes')
else:
print('No') |
p02971 | s403796802 | Wrong Answer | n = int(input())
ll = [[] for _ in range(n+1)]
count = 1
for i in range(n):
ll[0].append(int(input()))
ll[count] = ll[0].copy()
ll[count][count-1] = 0
max = 0
for j in ll[count]:
if j>max:
max = j
else:
pass
print(max)
count+=1
|
p03617 | s569952095 | Wrong Answer | Q, H, S, D = map(int, input().split())
N = int(input())
cQ = Q*4
cH = H*2
cS = S
cD = D / 2
m = min(cQ, cH, cS, cD)
if m == cQ:
print(cQ * N)
elif m == cH:
print(cH * N)
elif m == cS:
print(cS * N)
else:
if N % 2 == 0:
print(D * N // 2)
elif N == 1:
print(min(cQ, cH, cS))
else:
c = (N-1)*cD
print(c + min(cQ, cH, cS)) |
p02842 | s527987717 | Accepted | import math
n=int(input())
x0 = n * 100 / 108
x1 = (n+1) * 100 / 108
if x0.is_integer():
print(math.floor(x0))
elif x1.is_integer():
print(':(')
elif math.floor(x0) != math.floor(x1):
print(math.floor(x1))
else:
print(':(')
|
p02718 | s737119700 | Wrong Answer | N, M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
cnt = 0
print(N, M)
print(A)
for i in range(N):
if A[i] >= vote / 4 / M:
cnt += 1
else:
continue
if cnt >= M:
print('Yes')
else:
print('No') |
p02639 | s925713405 | Accepted | x = list(map(int, input().split()))
print(x.index(0)+1) |
p03293 | s806104434 | Accepted | # B - String Rotation
from collections import deque
S = deque(str(input()))
T = deque(str(input()))
N = len(S)
ans = 'No'
for _ in range(N):
S.append(S.popleft())
if S == T:
ans = 'Yes'
print(ans) |
p03219 | s112374725 | Accepted | X,Y = map(int,input().split())
print(X + Y//2) |
p02922 | s783986798 | Accepted | a, b = map(int, input().split())
x = 0
y = 1
while y < b:
y += (a - 1)
x += 1
print(x) |
p02777 | s053310734 | Accepted | S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
A -= 1
elif U == T:
B -= 1
print("{} {}".format(A, B)) |
p03449 | s640808853 | Wrong Answer | n = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
r = A1[0]+A2[-1]
for i in range(1, n-1):
r += A1[i]
if sum(A1[i+1:]) < sum(A2[i:-1]):
r += sum(A2[i:-1])
break
if i == n-2:
r += A1[-1]
print(r) |
p03387 | s652274307 | Wrong Answer | a,b,c = map(int, input().split())
s = a+b+c
cnt = 0
while True:
s += 2
cnt += 1
if s%3==0:
if s//3 >= a and s//3 >= b and s//3>= c:
break
print(cnt) |
p03360 | s263777672 | Wrong Answer | num_list = list(map(int, input().split()))
k = int(input())
tmp_lists = []
for i in range(3):
ans_lists = num_list.copy()
ans_lists[i] = num_list[i]*(2**k)
tmp_lists.append(ans_lists)
max = 0
for list in tmp_lists:
sum = 0
for k in list:
sum += k
if max < sum:
max = sum
print(sum) |
p03352 | s332722692 | Wrong Answer | X=int(input())
import math
print(math.floor(math.pow(X,0.5))**2) |
p03417 | s791491328 | Accepted | N,M=map(int,input().split())
if M==1:
if N==1:
print(1)
elif N==2:
print(0)
else:
print(N-2)
elif M==2:
print(0)
else:
if N==1:
print(M-2)
elif N==2:
print(0)
else:
print((M-2)*(N-2)) |
p02712 | s397522656 | Accepted | n=int(input())
sum=0
for i in range(1,n+1):
if i%3!=0 and i%5!=0:
sum+=i
print(sum) |
p03012 | s624444425 | Accepted | n = int(input())
w = tuple(map(int, input().split()))
av_min = 100000
for i in range(n-1):
av = abs(sum(w[:i+1]) - sum(w[i+1:]))
if av < av_min:
av_min = av
else:
break
print(av_min) |
p03779 | s640429807 | Accepted | x = int(input())
for i in range(1, x + 1):
if i * (i + 1) / 2 >= x:
print(i)
break
|
p02820 | s995126328 | Accepted | N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())
hands = {'r': 'p', 'p':'s', 's': 'r'}
ans = 0
h = []
for i in range(N):
e = T[i]
if i >= K and h[i-K] == hands[e]:
h.append(None)
continue
if e == 'r':
h.append('p')
ans += P
elif e == 'p':
h.append('s')
ans += S
elif e == 's':
h.append('r')
ans += R
print(ans) |
p02742 | s543469074 | Accepted | import math
h, w = list(map(int,input().split()))
if h != 1 and w != 1:
print(math.ceil((h*w)/2))
else:
print(1) |
p03017 | s190859224 | Wrong Answer | N,A,B,C,D = map(int,input().split())
S = ['#']+list(input())
CanReach = True
CanChange = False
for i in range(A,C):
if S[i] == '#' and S[i+1] == '#':
CanReach = False
for i in range(B,D):
if S[i] == '#' and S[i+1] == '#':
CanReach = False
if C < D:
CanChange = True
for i in range(B-1,D-1):
if S[i] == '.' and S[i+1] == '.' and S[i+2] == '.':
CanChange = True
if CanReach and CanChange:
print('Yes')
else:
print('No') |
p03774 | s678510876 | Accepted | N,M = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(N)]
cd = [list(map(int,input().split())) for _ in range(M)]
for i in range(N):
dist = float("inf")
ans = 0
a,b = ab[i][0],ab[i][1]
for j in range(M)[::-1]:
c,d = cd[j][0],cd[j][1]
if abs(a-c) + abs(b-d) <= dist:
dist = abs(a-c) + abs(b-d)
ans = j + 1
print(ans) |
p02862 | s903010266 | Accepted | X, Y = map(int, input().split())
def comb(n, r, mod=10 ** 9 + 7):
n1 = n + 1
r = min(n, n - r)
numer = denom = 1
for i in range(1, r + 1):
numer = numer * (n1 - i) % mod
denom = denom * i % mod
return numer * pow(denom, mod - 2, mod) % mod
# x + y coordinates increase by 3 per one move
# x + y should be factor of 3
ans = 0
if (X + Y) % 3 == 0 and 2 * Y >= X and 2 * X >= Y:
# The number of up move and right move
up, right = (2 * Y - X) // 3, (2 * X - Y) // 3
# up + right = (X + Y) % 3
ans = comb(up + right, right)
print(ans) |
p02797 | s047569588 | Accepted | n,k,s=map(int,input().split());print(*[s]*k+[19]*(n-k)) |
p02767 | s889782407 | Accepted | N = int(input())
X = list(map(int, input().split()))
ans = 10 ** 7
for i in range(1, 101):#1から100で開催
ans1 = 0
for j in range(N):
ans1 += (X[j] - i) ** 2
ans = min(ans, ans1)
print(ans) |
p02699 | s077106968 | Accepted | S,W = list(map(int,input().split()))
if S<=W:
print("unsafe")
else:
print("safe") |
p02694 | s519630995 | Accepted | import math
X = int(input())
curr = 100
yrs = 0
while curr < X:
curr = math.floor(curr * 1.01)
yrs += 1
print(yrs) |
p03206 | s185253578 | Accepted | a = int(input())
if a == 22:
print('Christmas Eve Eve Eve')
elif a == 23:
print('Christmas Eve Eve')
elif a == 24:
print('Christmas Eve')
else:
print('Christmas') |
p03077 | s900755453 | Accepted | import math
n=int(input())
l=[int(input()) for i in range(5)]
print(math.ceil(n/min(l))+4) |
p03657 | s432709494 | Accepted | import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
if __name__ == '__main__':
b, c = map(int, input().split())
if b % 3 ==0 or c % 3 == 0 or (b+c) %3 ==0:
print("Possible")
else:
print("Impossible") |
p02731 | s718412507 | Accepted | l = int(input())
print((l / 3)**3)
|
p02720 | s902260481 | Accepted | k = int(input())
ans = list(range(1, 10))
next_ans = ans
while len(ans)<k:
temp_ans = []
for a in next_ans:
a_0 = int(str(a)[-1])
new_ans = [int(str(a)+str(a_0+i)) for i in [-1,0,1] if 0<=a_0+i<=9]
temp_ans.extend(new_ans)
ans.extend(temp_ans)
next_ans = temp_ans
print(ans[k-1]) |
p02947 | s293493395 | Wrong Answer | import collections
n = int(input())
s = [0]*n
c = {}
T = [0]*n
for i in range(n):
s[i] = input()
c[i] = collections.Counter(list(s[i]))
T[i] = str(c[i])
D = collections.Counter(T)
ans = 0
for i in D.values():
ans += i*(i-1)//2
print(ans) |
p02696 | s327198349 | Wrong Answer | from sys import stdin
import sys
import math
A, B, N = list(map(int, stdin.readline().rstrip().split()))
ans = []
#for x in range(N+1):
# ans.append(math.floor(A * x / B) - A * math.floor(x / B))
#loop = min(B+1 ,N+1)
#for x in range(loop):
# ans.append(math.floor(A * x / B) - A * math.floor(x / B))
max_ans = 0
for x in range(N+1)[::-1]:
ans = math.floor(A * x / B) - A * math.floor(x / B)
if ans < max_ans:
print(max_ans)
sys.exit()
else:
max_ans = ans
print(max_ans)
|
p02622 | s945137799 | Wrong Answer | s=list(input())
t=list(input())
cnt=0
for i,e in zip(s,t):
print(i,e)
if i != e:
cnt+=1
print(cnt) |
p02690 | s190321063 | Accepted | x = int(input())
for i in range(-1000,1000):
for j in range(-1000,1000):
if i ** 5 - j ** 5 == x:
print(i,j)
quit() |
p03475 | s755997330 | Wrong Answer | import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
n = int(input())
c = [0]*(n-1)
s = [0]*(n-1)
f = [0]*(n-1)
for i in range(n-1):
c[i], s[i], f[i] = map(int, input().split())
from functools import lru_cache
@lru_cache(None)
def dfs(eki,t):
if eki == n-1:
return t
cc = c[eki]
ss = s[eki]
ff = f[eki]
return dfs(eki+1, max(ss, -(-t)//ff*ff)+cc)
for i in range(n):
print(dfs(i,0))
|
p02712 | s749051524 | Accepted | n=int(input())
ans=0
for i in range(n+1):
if i%3==0 or i%5==0:
i=0
ans +=i
print(ans) |
p03043 | s664320855 | Accepted | n, k = map(int, input().split())
ans = 0
for i in range(n):
g = 1 / n
now = i+1
while (True):
if (now >= k):
break
now*=2
g/=2
ans += g
print(ans) |
p04011 | s747781174 | Accepted | n = int(input())
k = int(input())
x = int(input())
y = int(input())
o = n - k
sum = 0
if o > 0:
sum += k * x
sum += o * y
else:
sum += n * x
print(sum) |
p02657 | s720562252 | Accepted | a,b=map(int,input().split())
print(a*b) |
p03264 | s692627110 | Accepted | K = int(input())
if K % 2 == 0:
print((K//2)**2)
else:
print((K-1)//2 * ((K-1)//2 + 1)) |
p03360 | s695832017 | Accepted | a, b, c = map(int, input().split())
k = int(input())
m = max([a, b, c])
s = a + b + c - m + m * 2 ** k
print(s) |
p02843 | s454885331 | Accepted | x = int(input())
a = x%100
n = x//100
if a <= 5*n:
print("1")
else:
print("0") |
p02600 | s367282695 | Accepted | n = int(input())
print((1999-n)//200+1) |
p02779 | s789211139 | Accepted | N = int(input())
A = list(map(int, input().split()))
setA = set(A)
if len(setA) == N:
print('YES')
else:
print('NO') |
p03625 | s317621965 | Wrong Answer | from collections import Counter
n=int(input())
A=list(map(int,input().split()))
A=Counter(A)
S=[]
for i,j in A.items():
if j>=2:
S.append(i)
S.sort()
if len(S)>=2:
print(S[-1]*S[-2])
else:
print(0)
|
p03059 | s241265534 | Wrong Answer | import math
a,b,t = map(int,input().split())
b*(t//a) |
p02859 | s742497291 | Accepted | a = int(input())
b = a**2
print(b)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.