problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02755 | s676235896 | Wrong Answer | import math
A, B = map(int, input().split())
r=100000
x = math.floor(A/0.08)
y = math.floor(B/0.1)
if(math.floor(x*0.1)!=B):
print("-1")
else:
while(y<x):
if(math.floor(y*0.1)==math.floor(y*0.08)):
if(y<r):
r=y
y+=1
print(r) |
p02712 | s671654815 | Wrong Answer | n = int(input())
tmp = n // 15
tmp2 = n % 15
d = [(15*(tmp) + i) for i in [0,1,2,0,4,0,0,7,8,0,0,11,0,13,14]]
for i in [0,3,5,6,9,10,12]:
d[i] = 0
(tmp **2 * 60) + sum(d[:(tmp2+1)]) |
p03785 | s089626037 | Accepted | N,C,K=map(int,input().split())
T=[int(input()) for i in range(N)]
T.sort()
res=0#乗客
time=0#発車K分前
ans=0
for i in range(len(T)):
if res!=0 and time+K<T[i]:
ans+=1
res=1
time=T[i]
else:
res+=1
if res==1:
time=T[i]
if res==C:
ans+=1
... |
p03329 | s950869493 | Accepted | n = int(input())
six = []
s = 6
while s <= n:
six.append(s)
s *= 6
s = 9
while s <= n:
six.append(s)
s *= 9
six.sort()
dp = [i for i in range(n+13)]
for s in six:
for i in range(n-s+1):
if dp[i] + 1 < dp[i+s]:
dp[i+s] = dp[i] + 1
print(dp[n])
|
p02682 | s803522581 | Wrong Answer | a, b, c, k = map(int, input().split())
if k <= a:
print(a)
elif k <= a+b:
print(a)
else:
print(a-(k-a-b)) |
p02866 | s074501733 | Wrong Answer | import math
import sys
n=int(input())
d=list(map(int,input().split()))
if d[0]!=0 or 0 in d[1:]:
print(0)
sys.exit()
lis=[0 for i in range(n)]
for i in range(n):
lis[d[i]]+=1
s=1
i=0
while i+1<=n-1 and lis[i+1]!=0:
s=(s*pow(lis[i],lis[i+1],998244353))%998244353
i+=1
print(s) |
p03827 | s779081359 | Wrong Answer | s=input()
ans=0
k=0
for i in s:
if i=='I':
k+=1
ans=max(ans,k)
elif i=='D':
k-=1
print(ans)
|
p03095 | s596512957 | Accepted | from collections import Counter
N = int(input())
S = list(input())
C = Counter(S)
count = 1
mod = 10**9 + 7
for i in C.values():
count *= i+1
print((count-1)%mod) |
p03557 | s724221116 | Wrong Answer | import bisect
N = int(input())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
al.sort()
# print(al)
bl.sort()
# print(bl)
cl.sort()
# print(cl)
cnt = 0
for b in range(N):
idx = bisect.bisect_left(al, bl[b]) # bl[b] = 6 idx= 3
cnt_ab = idx - 1
... |
p02989 | s526626209 | Wrong Answer | n=int(input())
d=list(map(int, input().split()))
#print(d)
sd = sorted(d)
##print(sd[len(d)//2-1])
print(sd[len(d)//2])
print(sd[len(d)//2] - sd[len(d)//2-1] +1) |
p04034 | s166897461 | Accepted | import collections
n,m = map(int,input().split())
box = [[1,"white"] for i in range(n)]
box[0][1] = "red"
for i in range(m):
x,y = map(int,input().split())
x -= 1
y -= 1
if box[x][1] == "red":
box[y][1] = "red"
box[y][0] += 1
box[x][0] -= 1
if box[x][0] == 0:
box[x][1] = "whi... |
p03137 | s526034552 | Accepted | n, m = list(map(int, input().split()))
x = list(map(int, input().split()))
x.sort()
diffs = []
for i in range(m - 1):
diffs.append([i, x[i + 1] - x[i]])
diffs = sorted(diffs, key=lambda x: -x[1])
diffs = list(map(lambda x: [x[0], x[0] + 1], diffs[:(n - 1)]))
diffs = [[0, 0]] + sorted(diffs) + [[(len(x) - 1), (len(x... |
p04020 | s461182969 | Wrong Answer | n = int(input())
a = []
for _ in range(n):
a.append(int(input()))
ans = 0
for i in range(n):
ans += a[i] // 2
a[i] %= 2
for i in range(n-1):
if a[i]+a[i+1] == 2:
ans += 1
a[i],a[i+1] = 0,0
print(ans) |
p02963 | s344694284 | Accepted | n = int(input())
N = 10**9
x1=0
y1=0
x2=N
y2=1
x3=N-n%N
y3=n//N+1
if n==10**18:
x3=0
y3=n//N
print(x1,y1,x2,y2,x3,y3)
|
p02552 | s059515654 | Accepted | a = int(input())
print(1-a) |
p03001 | s250557249 | Wrong Answer | W, H, x, y = map(int, input().split())
S = W * H / 2
print (S, end = ' ')
if W == 2 * x and H == 2 ** y:
print (1)
else:
print (0) |
p02665 | s418103236 | Accepted | N = int(input())
A= list(map(int, input().split()))
S = sum(A)
ans = 0
leaf = 1
S_now = 0
if A[0] == 1:
if N==0:
print(1)
else:
print(-1)
elif A[0] != 0:
print(-1)
else:
for i in range(N):
ans += leaf
leaf -= A[i]
S_now += A[i]
leaf = min(leaf*2,S-S_now)
if A[-1] != leaf:
print(-... |
p03994 | s623158585 | Accepted | def need(a):
if a=="a":
return 0
else:
return 123-ord(a)
s=list(input())
x=int(input())
i=0
while x>0:
count=need(s[i])
if x>=count:
s[i]="a"
x-=count
if i==len(s)-1:
s[i]=chr(ord(s[i])+(x%26))
x=0
i+=1
print("".join(s)) |
p02994 | s084229033 | Accepted | N, L = map(int,input().split())
def taste(i):
return L + i
m = 1e+10
t = 0
appleN = [taste(i) for i in range(N)]
for n in range(N):
appleN_1 = [taste(i) for i in range(N) if i != n]
m = min(m, abs(sum(appleN) - sum(appleN_1)))
if m == abs(sum(appleN) - sum(appleN_1)):
t = sum(appleN_1)
print(t) |
p02760 | s973014553 | Accepted | a = [list(map(int, input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
flag = False
for i in range(3):
if all(a[i][j] in b for j in range(3)): #bの中にa[i][j]があるかどうか
flag = True
if all(a[j][i] in b for j in range(3)):
flag = True
if all(a[i][i] in b for i in r... |
p02786 | s788490711 | Accepted | h = int(input())
cnt = 0
if h == 1:
print(1)
quit()
while h > 1:
h = h // 2
cnt += 1
print(2**(cnt+1)-1) |
p03126 | s345770194 | Wrong Answer | n, m = map(int, input().split())
suki = [0]*(m+1)
for i in range(n):
ka = list(map(int, input().split()))
for j in range(ka[0]):
suki[ka[j]] += 1
ans = 0
for i in range(1, m+1):
if suki[i] == n:
ans += 1
print(ans)
|
p03705 | s842943016 | Accepted | N, A, B = map(int, input().split())
if N == 1:
if A == B: print(1)
else:print(0)
exit()
if A > B:
print(0)
exit()
m = A + (N-2)*A + B
M = A + (N-2)*B + B
print(max(0,M-m+1)) |
p02873 | s033324315 | Wrong Answer | s = input()
big = 0
small = 0
n = 0
big2 =0
for i in range(len(s)):
if s[i]=='<':
big += 1
n += big
small =0
big2 = big
else:
small += 1
n += small
if small<=big2:
n-=1
big =0
print(n) |
p02712 | s470485554 | Accepted | N=int(input())
ans=0
for n in range(N):
n+=1
if n%5!=0 and n%3!=0:
ans+=n
print(ans) |
p03639 | s974780771 | Accepted |
N = int(input())
a = list(map(int,input().split()))
b0,b1,b2 = 0,0,0
for i in range(N):
if a[i]%2==1:
b0+=1
elif a[i]%4==0:
b2+=1
else:
b1+=1
# print('b0,b1,b2:',b0,b1,b2)
if b1==0:
if b2>=b0-1:
print('Yes')
else:
print('No')
else:
b0+=1
if b2>=b0-... |
p03103 | s747513980 | Accepted | n, m = map(int, input().split())
a, b = [], []
for i in range(n):
te, mp = map(int, input().split())
a.append(te)
b.append(mp)
e, f = [], []
for i, j in sorted(zip(a, b)):
e.append(i)
f.append(j)
ans = 0
for i in range(n):
if m - f[i] <= 0:
ans += e[i] * m
print(ans)
ex... |
p03062 | s205344994 | Wrong Answer | n=int(input())
a=[0]*n
a=map(int,input().split())
z=0
p=0
result=0
min=1000000002
for i in a:
if i<0:
z+=1
if i==0:
p=1
result+=abs(i)
if abs(i)<min:
min=abs(i)
if p==0 & z%2==1:
result-=min*2
print(result) |
p02707 | s257345732 | Accepted | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
cnt = Counter(A)
for i in range(N):
print(cnt[i+1]) |
p03408 | s741351711 | Wrong Answer | N = int(input())
S = [input() for _ in range(N)]
M = int(input())
T = [input() for _ in range(M)]
ans = 0
for i in range(N):
if S.count(S[i]) >= T.count(S[i]):
ans = S.count(S[i]) - T.count(S[i])
print(ans) |
p03352 | s077588781 | Wrong Answer | X=int(input())
l=[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961]
for i in range(len(l)):
if X<l[i]:
print(l[i-1])
exit()
print(l[-1]) |
p03448 | s809071755 | Accepted | A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for i in range(A + 1):
for j in range(B + 1):
for k in range(C + 1):
if X == 500 * i + 100 * j + 50 * k:
count += 1
print(count) |
p03387 | s910849329 | Wrong Answer | a, b, c = map(int, input().split())
C = sorted(list([a, b, c]))
d1 = C[2] - C[0]
d2 = C[2] - C[1]
if (d2 - d1) % 2 == 0:
print(d2 + (d1 - d2)//2)
else:
print(d2 + 2) |
p03437 | s927740946 | 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()))
x,y = iim()
if y == 1 or x%y == 0:
print(-1)
else:
print(x*(y-1)) |
p02554 | s305470718 | Accepted | num = int(input())
mod = 10 ** 9 + 7
ans = 0
if num >= 2:
temp9 = (9 ** num) % mod
temp8 = (8 ** num) % mod
val = (temp9 * 2 - temp8) % mod
ans = (10 ** num) % mod + mod - val
print(ans % mod) |
p03545 | s676050790 | Accepted | ABCD = input()
def dfs(i, f, sum):
if i==3:
if sum==7:
print(f + '=7')
exit()
else:
dfs(i+1, f + "-" + ABCD[i+1], sum - int(ABCD[i+1]))
dfs(i+1, f + "+" + ABCD[i+1], sum + int(ABCD[i+1]))
dfs(0, ABCD[0], int(ABCD[0])) |
p03359 | s359450963 | Wrong Answer | a, b = map(int, input().split())
c = 0
for i in range(1,a+1):
for j in range(1, b+1):
if i == j:
c +=1
print(c) |
p02665 | s074345671 | Accepted | N = int(input())
A = list(map(int, input().split()))
not_in = [0 for i in range(N+1)]
not_in[0] = A[0]
for i in range(1, N+1):
not_in[i] = not_in[i-1] * 2 + A[i]
if not_in[N] > 2 ** N:
print(-1)
else:
in_num = 0
up = A[N]
for i in range(N-1,-1,-1):
in_temp = min(2 ** i - not_in[i], up)
in_num += in_... |
p02598 | s016105768 | Accepted | #!/usr/bin/env python
# coding: utf-8
# In[16]:
N,K = map(int, input().split())
A = list(map(int, input().split()))
# In[49]:
low = 0
high = max(A)
def ok(x):
cnt = 0
for a in A:
cnt += (a//x)
if a%x == 0:
cnt -= 1
return cnt <= K
while high-low > 1:
mid = (high+low)... |
p02780 | s038207298 | Wrong Answer | n, k = map(int, input().split())
p = list(map(int, input().split()))
total_expects = []
# 1回のサイコロについて
for i in range(0, n):
# 1個のサイコロの期待値リスト
expect = [q * (1 / p[i]) for q in range(1, p[i]+1)]
total_expects.append(sum(expect))
print(max([sum(total_expects[i:i+k]) for i in range(0, k)]))
|
p03862 | s351526647 | Accepted | n,x = map(int,input().split())
a = list(map(int,input().split()))
ans = [[0]*2 for i in range(n)]
ans[0][0] = max(0,a[0] - x)
ans[0][1] = a[0] - ans[0][0]
for i in range(1,n):
al = max(0,ans[i-1][1] + a[i] - x)
ans[i][0] = ans[i-1][0] + al
ans[i][1] = a[i] - al
print(ans[n-1][0]) |
p02973 | s785589744 | Accepted | #!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
n = int(input())
A = [int(input()) for i in range(n)]
dp = [-inf] * (10**5+10);dp[-1] = inf
for ai in A:... |
p02708 | s899743085 | Accepted | import sys
input = sys.stdin.readline
from collections import *
from math import *
N, K = map(int, input().split())
MOD = 10**9+7
ans = 0
for i in range(K, N+2):
c = ((2*N-i+1)*i)//2-i*(i-1)//2+1
ans += c
ans %= MOD
print(ans) |
p02553 | s459190997 | Accepted | [a, b, c, d] = [int(inp) for inp in input().split()]
print(max([a * c, b * d, a * d, b * c])) |
p02761 | s696771892 | Accepted | import sys
n,m=map(int,input().split())
d=dict()
if n==1 and m==0:
print("0")
sys.exit()
l=[-1]*n
for _ in range(m):
s,c=map(int,input().split())
s-=1
if (s in d.keys() and d[s]!=c) or s>=n:
print("-1")
sys.exit()
d[s]=c
l[s]=c
if l[0]==0 and n>1:
print("-1")
sys.exit()
for i in range(n):
if... |
p02766 | s401197396 | Accepted | n,k=map(int,input().split())
a=0
while n:
n=n//k
a+=1
print(a)
|
p02963 | s535406538 | Wrong Answer | S=int(input())
a=S%(10**9)
b=10**9-a
print(0,0,1,10**9,(S+b)//(10**9),b) |
p03693 | s282244532 | Wrong Answer | r,g,b = input().split()
is_four_multiple = g+b
if int(is_four_multiple) % 4 == 0:
print("Yes")
else:
print("No")
|
p02696 | s626365227 | Wrong Answer | import sys
A, B, N = map(int, input().split())
ans = [int((A*(i+(B-1)))/B) - (A*i) for i in range(N+1) if i % B == 0]
ans.append(0)
print(max(ans)) |
p02624 | s871099944 | Accepted | n=int(input())
sums=0
i=1
while i<=n:
m=n//i
sums=sums+((m+1)/2*m)*i
i=i+1
print(int(sums)) |
p02881 | s108097788 | Accepted | n = int(input())
ans = 1
i=1
while i*i<=n:
if n%i==0:
ans = i
i+=1
ans += n//ans
ans -= 2
print(ans) |
p02983 | s041584876 | Accepted | L, R = map(int, input().split())
reg = 2018
if R-L >= 3000:
print(0)
else:
for l in range(L, R):
for r in range(l+1, R+1):
tmp = (l * r) % 2019
reg = min(reg, tmp)
print(reg) |
p03644 | s364855253 | Accepted | list = [64,32,16,8,4,2]
O = int(input())
if O == 1:
print(1)
exit()
for num in list:
if O >= num:
print(num)
break
|
p02684 | s030967366 | Wrong Answer | n,k = map(int,input().split())
a = [int(i) for i in input().split()]
done = []
def ml(a):
cnt=1
nxt=a[0]-1
done.append(0)
done.append(nxt)
while(True):
nxt = a[nxt]-1
if nxt in done:
m = done.index(nxt) - 1
l = cnt - m
return (m+1,l)
else: done.append(nxt)
cnt+=1
# print(is_1(a))
m,l = ml(a)
nu... |
p03433 | s751507388 | Accepted | N = int(input())
A = int(input())
if N%500 <= A:
print('Yes')
else:
print('No') |
p02606 | s247147737 | Accepted |
def submit():
l, r, d = map(int, input().split())
cnt = 0
for t in range(l, r + 1):
if t % d == 0:
cnt += 1
print(cnt)
submit() |
p02684 | s104316611 | Accepted | N,K=map(int,input().split())
A=list(map(int,input().split()))
A=[A[i]-1 for i in range(N)]
doubling=[[0 for i in range(N)] for i in range(0,70)]
for i in range(N):
doubling[0][i]=A[i]
for i in range(1,70):
for j in range(N):
doubling[i][j]=doubling[i-1][doubling[i-1][j]]
ans=0
for i in range(0,70):
... |
p02647 | s066474166 | Wrong Answer | from itertools import accumulate
N, K = map(int, input().split())
A = list(map(int, input().split()))
if all([a == 0 for a in A]):
print(*A)
exit()
for k in range(min(50, K)):
B = [0]*N
for i in range(N):
B[max(0, i-A[i])] += 1
r = i+A[i]+1
if r < N:
B[r] -= 1
A =... |
p02935 | s044881342 | Accepted | N = int(input())
A = list(map(int, input().split()))
while len(A) > 1:
A.sort()
x, y = A.pop(0), A.pop(0)
v = (x + y) / 2
A.append(v)
print(*A)
|
p03107 | s007886728 | Accepted | #!/usr/bin/env python3
s = input()
cnt1 = 0
cnt2 = 0
for i in s:
if i == "0":
cnt1 += 1
else:
cnt2 += 1
print(2*min(cnt1,cnt2))
|
p03524 | s207454781 | Accepted | from collections import Counter
s = input()
n = len(s)
count = [0 for i in range(3)]
for i in range(n):
count[ord(s[i]) - ord('a')] += 1
count.sort()
if count[2] - count[0] > 1:
print("NO")
else:
print("YES") |
p02922 | s718124508 | Accepted | import sys
A, B = map(int, input().split())
if B<=1:
print(0)
sys.exit()
for i in range(1,23):
if i*(A-1)+1 >= B:
print(i)
sys.exit() |
p02780 | s760873224 | Accepted | def main():
n, k = map(int, input().split())
P = list(map(int, input().split()))
# print(exp_sum(n, k, P))
mx = 0
for i in range(k):
mx += (P[i] + 1) / 2
tmp = mx
for i in range(k, n):
tmp += (P[i] - P[i - k]) / 2
mx = max(mx, tmp)
print(mx)
if __name__ == "__ma... |
p03474 | s972511086 | Accepted | A,B=map(int,input().split());S=input();print('Yes' if S[:A].isdigit() and S[A]=='-' and S[B+1:].isdigit() else 'No') |
p02727 | s661789326 | Wrong Answer | X,Y,A,B,C = map(int,input().split())
p,q,r = [sorted(map(int,input().split()),reverse=True) for i in range(3)]
rr = [0 for i in range(X+Y)]
for i in range(min(X+Y,C)):
rr[i] += r[i]
temp = sum(rr)
ans = 0
count = X+Y-1
for i in range(X):
temp += p[i]
temp -= rr[count]
count -= 1
count_2 = count
... |
p03076 | s673998676 | Accepted | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
L = list(map(int, read().decode("utf-8").split()))
last_ = L[0] % 10
last_index = 0
for i, t in enumerate(L):
if 0 < t % 10 < last_:
last_ =... |
p02910 | s160835146 | Accepted |
S = input()
print("No" if "L" in S[::2] or "R" in S[1::2] else "Yes")
|
p03637 | s954446168 | Accepted | N = int(input())
A = list(map(int, input().split()))
X = [0, 0, 0]
for a in A:
if a % 2 == 1:
X[0] += 1
elif a % 4 == 2:
X[1] += 1
else:
X[2] += 1
if X[1] == 0:
if X[2] >= X[0] - 1:
print("Yes")
else:
print("No")
else:
if X[2] >= X[0]:
print("Yes")
else:
print("No") |
p03679 | s698912143 | Wrong Answer | x, a, b = map(int, input().split())
d = -1*a + b
if(d <= 0):
print("delicious")
elif(abs(d) <= x+1):
print("safe")
else:
print("dangerous") |
p04005 | s766100818 | Accepted | a, b, c = map(int, input().split())
if a % 2 == 0 or b % 2 == 0 or c % 2 == 0:
print(0)
else:
chk = [a, b, c]
chk.sort()
print(chk[0] * chk[1]) |
p03611 | s645658172 | Wrong Answer | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(input())
a = list(map(int, input().split()))
t = [0] * (max(a) + 1)
for v in a:
t[v] += 1
ans = 0
for i in range(1, max(a) - 1):
ans = max(ans, t[i] + t[i+1] + t[i+2])
print(ans)
|
p03434 | s679136679 | Accepted | #!/usr/bin/env python3
def main():
N = int(input())
aList = list(map(lambda x: int(x), input().split()))
aliceValue = 0
bobValue = 0
isAliceTurn = True
while len(aList) > 0:
maxValue = max(aList)
aList.remove(maxValue)
if isAliceTurn:
aliceValue += maxValue... |
p02957 | s853764859 | Accepted | a,b=map(int,input().split())
if (a+b)%2==0:
print((a+b)//2)
else:
print("IMPOSSIBLE")
|
p02718 | s474287031 | Wrong Answer | NM=list(map(int,input().split()))
N=NM[0]
M=NM[1]
N_list=list(map(int,input().split()))
total=sum(N_list)
total=total/4
counter=0
for number in N_list:
if number>=total/4:
counter+=1
if counter>=M:
print('Yes')
else:
print('No') |
p03434 | s653020566 | Wrong Answer | n = int(input())
card = list(map(int,input().split()))
card.sort()
for i in range(n//2):
ans = card[2*i]-card[2*i+1]
if n%2==1:
ans += card[-1]
print(ans) |
p02571 | s159007250 | Wrong Answer | s = input()
t = input()
ans = len(t)
for i in range(len(s)):
if (i + len(t)>= len(s)): break
dif = 0
for j in range(len(t)):
if (s[i + j] != t[j]):
dif += 1
ans = min(ans, dif)
print(ans) |
p02645 | s291520290 | Wrong Answer | import random
s = input()
start = random.randint(0,len(s)-2)
nickname = s[start:start+3]
print(nickname)
|
p03427 | s835287551 | Wrong Answer | X = input()
if X[0] == 1:
X2 = [9]*(len(X) - 1)
elif X.count("9") == len(X):
X2 = X
else:
tmp = int(X[0])-1
X2 = [str(tmp)] + ["9"]*(len(X)-1)
print(sum(list(map(int, X2)))) |
p02657 | s123479838 | Accepted |
#1,入力をちゃんと受け取る
# ex:「2 5] →a=2,b=5 みたいにする
a, b = map(int, input().split())
#print(a)
#print(b)
#2,目的通りの計算
# ex:二つの整数AとBの掛け算をする
answer = a * b
#計算の結果を出力する
print(answer) |
p03126 | s878376858 | Accepted | import sys
input = lambda: sys.stdin.readline().rstrip()
N, M = map(int,input().split())
ans = []
flg = 0
for i in range(N):
if flg == 0:
K = list(map(int, input().split()))
K = K[1:]
ans += K
flg = 1
else:
K = list(map(int, input().split()))
K = K[1:]
... |
p03243 | s554776860 | Accepted | n = input()
if int(n[0]*len(n)) >= int(n):
print(n[0]*len(n))
else:
print(str(int(n[0])+1)*len(n)) |
p03456 | s302347019 | Accepted | b, c = map(str, input().split())
d = b+c
for n in range(int(d)):
if n == 0:
continue
if ((int(d)/n) == n):
print('Yes')
break
if (n+1) == int(d):
print('No') |
p02719 | s112317948 | Accepted | N,K=map(int,input().split())
a=N%K
b=K/2
if a<=b:
print(a)
else:
print(K-a) |
p02899 | s753314099 | Accepted | N = int(input())
A_i = list(map(int, input().split()))
result = [None] * N
for i in range(N):
result[A_i[i]-1] = i+1
print(' '.join(map(str, result)))
|
p02571 | s387962834 | Accepted | s = input()
t = input()
ans = len(t)
for i in range(len(s) - len(t) + 1):
ss = s[i:i + len(t)]
# print(ss)
cnt = 0
for i,e in enumerate(ss):
if e != t[i]:
cnt += 1
# print(cnt)
ans = min(ans,cnt)
print(ans)
|
p03836 | s697329476 | Accepted |
import sys
import fractions
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
sx, sy, tx, ty = lr()
ans = ""
ans += "R" * (tx - sx)
ans += "U" * (ty - sy)
ans += "L" * (tx - sx)
ans += "D" * (ty - sy)
ans += "D"
ans += "R" * (tx - sx + 1)
ans += "U" * (ty - ... |
p02912 | s021916776 | Accepted | n,m = map(int,input().split())
A = list(map(lambda x:-int(x),input().split()))
import heapq
heapq.heapify(A)
for i in range(m):
a = heapq.heappop(A)
heapq.heappush(A,-(-a//2))
print(-sum(A))
|
p02602 | s880590516 | Accepted | n,k=map(int,input().split())
l=list(map(int,input().split()))
for i in range(k,n):
if l[i] > l[i-k]:
print('Yes')
else:
print('No')
|
p02779 | s498654588 | Wrong Answer | N=input()
A = list(map(int, input().split()))
A_set = set(A)
if len(A)==len(A_set):
print('Yes')
else:
print('No') |
p03448 | s482741681 | Accepted | a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for an in range(a + 1):
for bn in range(b + 1):
for cn in range(c + 1):
total = an * 500 + bn * 100 + cn * 50
if total == x:
ans += 1
print(ans)
|
p03345 | s865506712 | Accepted | import math
import sys
import collections
import bisect
def main():
a, b, c, k = map(int, input().split())
print((-1) ** k * (a - b))
if __name__ == '__main__':
main()
|
p03774 | s089589617 | Wrong Answer | N,M = map(int,input().split())
Ls = []
Lp = []
for i in range(N):
a,b = map(int,input().split())
Ls.append([a,b])
for m in range(M):
c,d = map(int,input().split())
Lp.append([c,d])
dis =[]
for i in range(N):
for m in range(M):
dis.append(abs(Ls[i][0]-Lp[m][0])+abs(Ls[i][1]-Lp[m][1]))
pri... |
p03623 | s109480160 | Wrong Answer | A, B, X = map(int, input().split())
if (A - X) * (A - X) < (B - X) * (B - X) : print('A')
else : print('B') |
p03998 | s672357315 | Wrong Answer | a = input()
b = input()
c = input()
turn = "a"
while not(a == "" or b == "" or c == ""):
if turn == "a":
turn = a[0]
a = a[1:]
if turn == "b":
turn = b[0]
b = b[1:]
if turn == "c":
turn = c[0]
c = c[1:]
turn = turn.upper()
print(turn) |
p02917 | s636841256 | Accepted | n = int(input())
b = [int(x) for x in input().split()]
ans = [0 for x in range(n)]
ans[n-1] = b[n-2]
ans[0] = b[0]
for i in range(1,n-1) :
j = n - 1 - i
ans[j] = min(b[j],b[j-1])
print(sum(ans)) |
p02767 | s559988123 | Wrong Answer | N=int(input())
X=list(map(int,input().split()))
print(sum([(xi-(sum(X)+N-1)//N)**2 for xi in X])) |
p02571 | s313087175 | Wrong Answer | S = input()
T = input()
for i in range(len(T), 0, -1):
for j in range(len(T)-i+1):
subst = T[j:i+j]
# print(subst)
if S.find(subst, j)>=0:
print (len(T)-i)
exit(0)
|
p02711 | s638480488 | Accepted | N = list(input())
if "7" in N:
print("Yes")
else:
print("No") |
p02811 | s452371483 | Accepted | a,b = map(int, input().split())
if a*500 >= b:
print("Yes")
else:
print("No") |
p02993 | s032247482 | Accepted | s = input()
x = 0
for i in range(0,3):
if s[i] == s[i+1]:
x = x + 1
if x >= 1:
print("Bad")
else:
print("Good") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.