problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02570 | s443893463 | Accepted | d,t,s = map(int, input().split())
if d / s <= t:
print("Yes")
else:
print("No") |
p02598 | s452255931 | Wrong Answer | n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
l = 0
r = max(a)
while l < r:
m = (l + r) // 2
cnt = 0
for v in a:
if m == 0:
cnt += 2 * v
else:
cnt += (v + m - 1) // m - 1
if cnt <= k:
r = m
else:
l = m + 1
pri... |
p04033 | s828626836 | Accepted | #! /usr/bin/env python3
import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)
A, B = map(int, readline().split())
if A <= 0 and B >= 0:
print("Zero")
elif A > 0:
print("P... |
p03951 | s451836991 | Wrong Answer | n = int(input())
s = input()
t = input()
if s == t:
print(n)
exit()
s = s[::-1]
i = 0
res = 0
while True:
if s[i] != t[i]:
break
i += 1
res += 1
print(2 * n - res)
|
p02802 | s367464827 | Accepted | def main():
k, n = map(int, input().split())
dp = [0] * (k+1)
dq = [0] * (k+1)
pen = 0
for i in range(n):
p,q = input().split()
p = int(p)
if dp[p] == 0:
if q == 'WA':
dq[p] += 1
elif q == 'AC':
dp[p] = 1
... |
p02848 | s582288325 | Accepted | #ord('A') , ord('Z') (65, 90)
n = int(input())
s = input()
#n = 2
#s = 'ABCXYZ'
ans = ''
for i in s:
x = ord(i) + n
if x > 90:
x = 65 + x % 90 -1
ans += chr(x)
print(ans) |
p03137 | s499314441 | Wrong Answer | N,M=map(int,input().split())
if N>=M:
X=[int(i) for i in input().split()]
print(0)
else:
X=[int(i) for i in input().split()]
a=sorted(X)
d=[]
for i in range(M-1):
d.append(a[i+1]-a[i])
k=sorted(d)
del k[-(N-1):]
print(sum(k))
|
p02642 | s682877940 | Accepted | import math , sys
N = int( input() )
A = list( map( int, input().split() ))
A.sort()
Cs = [0 for _ in range(10**6+1)]
M = A[-1]
#print(A)
i=0
M = max(A)
for i in range(N):
e = A[i]
if Cs[e]==1:
Cs[e]=2
elif Cs[e]==0:
Cs[e]=1
for i in range(len(Cs)):
Cs[i] = Cs[i]%2
for e in A:
i =... |
p02552 | s273990917 | Wrong Answer | x = input()
if x == 0:
print(1)
elif x == 1:
print(1)
else:
pass |
p02660 | s104469012 | Accepted | import collections
n = int(input())
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)
c = collections.Counter(a)
l = list(c.values())
def func(n):
i = 2
counter = 1
while co... |
p02729 | s255406662 | Accepted | from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")
def main():
N, M = map(int, input().split())
res = N * (N-1) // 2 + M * (M-1) // 2
print(res)
if __name__ == '__main__'... |
p02989 | s916147567 | Accepted | x=int(input())
y=list(map(int, input().split()))
y.sort()
a=y[len(y)//2]
b=y[(len(y)//2)-1]
if a==b:
print(0)
else :
print(a-b) |
p03852 | s848696646 | Accepted | a = input()
if a =='a' or a == 'e' or a == 'i' or a == 'o' or a == 'u':
print('vowel')
else:
print('consonant') |
p03221 | s343980578 | Accepted | def c_id():
from collections import defaultdict
N, M = [int(i) for i in input().split()]
Cities = [[int(i) for i in input().split()] for j in range(M)]
dic = defaultdict(list)
# 県毎に市をまとめる
for p, y in Cities:
dic[p].append(y)
# 市の認識番号を (座標) 圧縮
for p, lst in dic.items():
d... |
p02595 | s140528845 | Accepted | N,D=map(int,input().split())
XY=[]
ans=0
for i in range(N):
x,y=map(int,input().split())
if D>=(x**2+y**2)**0.5:
ans+=1
print(ans) |
p03107 | s968466358 | Accepted |
def resolve():
import sys
input = sys.stdin.readline
s = input().rstrip()
r = 0
b = 0
for c in s:
if c == "0":
r += 1
else:
b += 1
print(min(r, b) * 2)
if __name__ == "__main__":
resolve()
|
p03086 | s894397092 | Wrong Answer | S = input()
max_length = 0
length = 0
for s in S:
if s in ["A", "C", "G", "T"]:
length += 1
else:
if length > max_length:
max_length = length
length = 0
print(max_length) |
p04012 | s826181583 | Accepted | import sys
def input(): return sys.stdin.readline().strip()
def resolve():
def main():
w=list(input())
w.sort()
if len(w)%2!=0:
return 'No'
else:
for i in range(0,len(w)-1,2):
if w[i]!=w[i+1]:
return 'No'
return... |
p02691 | s995694896 | Accepted | from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a_right = [i+ai for i,ai in enumerate(a,1)]
a_left = [i-ai for i,ai in enumerate(a,1)]
a_right_count = Counter(a_right)
a_left_count = Counter(a_left)
ans = 0
for k,v in a_right_count.items():
ans += v * a_left_count.get(k,0)
p... |
p02924 | s673033741 | Accepted | n=int(input())-1;print(n*(n+1)//2) |
p02595 | s109704112 | Accepted | import math
N, D = map(int, input().split())
p = [list(map(int, input().split())) for _ in range(N)]
cnt = 0
for x, y in p:
if D >= math.sqrt(x**2 + y**2):
cnt += 1
print(cnt)
|
p03377 | s192742263 | Accepted | a, b, x = map(int, input().split())
if a <= x <= a+b:
print('YES')
else:
print('NO') |
p03681 | s634183346 | Accepted | import math
n,m = map(int, input().split())
if n==m+1 or n==m-1:
ans = math.factorial(n)*math.factorial(m)
elif n==m:
ans = math.factorial(n)*math.factorial(m)*2
else:
ans = 0
print(ans%(10**9+7)) |
p03274 | s761671909 | Accepted | n, k = map(int, input().split())
A = list(map(int, input().split()))
ans = float('inf')
for L in range(n-k+1):
R = L + k
if A[L] < 0 and A[R-1] < 0:
ans = min(ans, abs(A[L]))
elif A[L] < 0 and 0 <= A[R-1]:
ans = min(ans, min(abs(A[L]), abs(A[R-1]))*2 + max(abs(A[L]), abs(A[R-1])))
else:... |
p03086 | s059902808 | Wrong Answer | S = input()
l = len(S)
max_cnt = 0
for i in range(l):
for j in range(i, l):
max_cnt = max(sum([1 if s == "A" or s == "C" or s == "G" or s == "T" else 0 for s in S[i : j + 1]]), max_cnt)
print(max_cnt) |
p03285 | s245852235 | Accepted | n=int(input())
cnt=0
for i in range(int(n//4)+1):
for j in range(int(n//7)+1):
if i*4+7*j==n:
cnt+=1
if cnt>0:
print("Yes")
else:
print("No") |
p03352 | s190990632 | Wrong Answer | from bisect import bisect_right
a = int(input())
dp = [1]
t = 1
while t**2<=10000:
dp.append(t**2)
t+=1
if dp[-1]==a:
print(dp[-1])
exit()
elif dp[-1] > a:
print(dp[-2])
exit()
print(dp[bisect_right(dp,a)-1])
|
p02948 | s440322304 | Wrong Answer | N, M = map(int, input().split())
work = [[]]*M
for i in range(N):
a, b = map(int, input().split())
if a <= M:
work[a-1] = work[a-1] + [b]
max = 0
num = []
for i in range(M):
num=sorted(num+work[i],reverse=True)
if len(num)>0:
max+=num[0]
num=num[1:]
if N-i < len(num):
... |
p02693 | s952502100 | Wrong Answer | K = int(input())
A, B = map(int, input().split())
l = 0
result = 'NG'
while l <= B:
l+=K
if l >= A:
result = 'OK'
print(result) |
p03862 | s657879877 | Accepted | n, x = map(int, input().split())
ns = list(map(int, input().split()))
ttl = 0
if ns[0] >= x:
ttl += ns[0] - x
ns[0] = x
for i in range(n - 1):
eat = max(0, ns[i]+ns[i+1]-x)
ttl += eat
ns[i + 1] -= eat
print(ttl)
|
p03345 | s735384401 | Wrong Answer | a,b,c,k=map(int,input().split())
if abs(a-b)<=10**18:
print(abs(a-b))
else:
print("Unfair") |
p03284 | s472683656 | Accepted | n,k = map(int,input().split())
if n % k == 0:
print(0)
else:
print(1) |
p02659 | s320398224 | Accepted | from decimal import Decimal
from math import floor
def main():
a, b = map(Decimal,input().split())
print(floor(a*b))
main() |
p03250 | s469113550 | Wrong Answer | a,b,c = map(str, input().split())
d = a+b
e = int(d)
f = b+c
g = int(f)
dic = []
dic.append(e+int(c))
dic.append(int(a)+g)
print(max(dic)) |
p03161 | s356108039 | Wrong Answer | import numpy as np
n, k = map(int, input().split())
arr = np.array([0] + list(map(int, input().split())) + [0] * 100)
INF = 1 << 60
dp = np.full(arr.shape[0] + 100, INF)
dp[1] = 0
for i in range(1, n + 1):
dp[i: i + k + 1] = np.minimum(dp[i: i + k + 1], dp[i] + np.abs(arr[i: i + k + 1] - arr[i]))
print(dp[n]) |
p02743 | s051915048 | Accepted | a, b, c = map(int, input().split())
if 4*a*b < (c-a-b)**2 and (c-a-b)>0:
print('Yes')
else:
print('No') |
p03161 | s037623393 | Wrong Answer | import sys
sys.setrecursionlimit(10**6)
n,k = map(int,input().split())
h = list(map(int, input().split()))
dp = [0] * n
if n > k:
for i in range(k):
dp[i]=abs(h[0]-h[i])
for i in range (k,n):
for j in range(1,k):
dp[i] = min(dp[i-k]+abs(h[i-k]-h[i]),dp[i-k-1]+abs(h[i-k-1]-h... |
p02760 | s131236397 | Wrong Answer | #配列準備
N = 3
A = []
for i in range(N):
array = list(map(int, input().strip().split()))
A.append(array)
#番号準備
N = int(input())
B = []
for i in range(N):
array = list(map(int, input().strip().split()))
B.append(array)
#確認
print("yes") |
p03679 | s806245340 | Accepted | X,A,B = map(int,input().split())
if B-A>=X+1:
print('dangerous')
elif B-A<=X and A<B:
print('safe')
elif B<=A:
print('delicious')
|
p02613 | s591128047 | Accepted | N = int(input())
results = ['AC', 'WA', 'TLE', "RE"]
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for _ in range(N):
r = input()
d[r] += 1
for i in range(4):
print(results[i] + ' x ' + str(d[results[i]])) |
p03799 | s950739457 | Wrong Answer | #45 C - Scc Puzzle
N,M = map(int,input().split())
for i in range(M//2+1):
if M//N < 2:
M += 2
N -= 1
break
M -= 2
N += 1
if M<2:
print(0)
else:
print(N-1) |
p03380 | s198464478 | Wrong Answer | _=int(input())
a=list(map(int,input().split()))
n=max(a)
rc=float('inf')
rd=0
r=0
for i in a:
if rc>abs(i-n/2):
r=i
rc=min(rc,abs(i-n/2))
print(n,r) |
p03524 | s552710903 | Wrong Answer | s = list(input())
a, b, c = s.count("a"), s.count("b"), s.count("c")
if abs(a - b) > 1 or abs(a - c) > 1 or abs(b - c) > 1:
print("No")
else:
print("YES") |
p02818 | s563613439 | Accepted | A, B, K = map(int, input().split())
A = A - K
if A>=0:
print(A, B)
exit()
B = B + A
A = 0
print(A, max(B, 0)) |
p02547 | s202669114 | Accepted | N=int(input())
D1,D2=[],[]
for i in range(N):
d1,d2=map(int,input().split())
D1.append(d1)
D2.append(d2)
flag=False
for i in range(2,N):
if D1[i-2]==D2[i-2] and D1[i-1]==D2[i-1] and D1[i]==D2[i]:
flag=True
break
if flag:
print('Yes')
else:
print('No') |
p02678 | s803329506 | Accepted | import queue
q = [1]
N, M = map(int, input().split())
ans = [-1 for i in range(N+1)]
path = [[] for i in range(N+1)]
for i in range(M):
A, B = map(int, input().split())
path[A].append(B)
path[B].append(A)
COUNTER = 0
while len(q)>0 :
now = q.pop(0)
for p in path[now]:
if ans[p]==-1:
ans[p]=now
... |
p02681 | s091207982 | Accepted | import sys
input = sys.stdin.readline
def main():
S = input().rstrip("\r\n")
T = input().rstrip("\r\n")
if S == T[:-1] and len(S) + 1 == len(T):
print("Yes")
else:
print("No")
if __name__ == "__main__":
main() |
p03136 | s611306272 | Accepted | _ = input()
*l, m = sorted(map(int, input().split()))
print("Yes" if sum(l) > m else "No") |
p03075 | s386018600 | Accepted | A=[int(input()) for z in range(6)]
if 2*(2*A[4]+A[3]-A[1]-2*A[0])<5*A[5]:
print('Yay!')
else:
print(':(') |
p03385 | s665762029 | Wrong Answer | S = sorted(input())
if S == "abc":
print("Yes")
else:
print("No") |
p03076 | s248149861 | Wrong Answer | def comTime(x):
return (x//10)*10 + 10
def solve(_l):
s = 0
l =sorted(_l, key=lambda x: x % 10 if x % 10 != 0 else 10)
s += sum(map(comTime,l[1:])) + l[0]
return s
_l = [int(input()) for _ in range(5)]
print(solve(_l)) |
p03433 | s923695169 | Accepted | n = int(input())
a = int(input())
if n%500 <= a:
print('Yes')
else:
print('No') |
p04034 | s695979815 | Accepted | n, m = list(map(int, input().split()))
xy = [list(map(int, input().split())) for i in range(m)]
ans = [1] * (n)
ans[0] = 1
ball = [False] * (n)
ball[0] = True
for i in range(m):
x, y = xy[i]
ans[y-1] += 1
ans[x-1] -= 1
if ball[x-1]:
ball[y-1] = True
if ans[x-1] == 0:
ball[x-1] = False
... |
p03495 | s208719153 | Wrong Answer | N,K = map(int,input().split())
A = list(map(int,input().split()))
dic = {}
for i in range(N):
if A[i] in dic:
dic[A[i]] += 1
else:
dic[A[i]] = 1
ks = list(dic.keys())
vs = list(dic.values())
vs.sort()
B = (len(ks))
cnt = 0
for i in range(len(vs)):
if B > K:
B -= vs[i]
c... |
p02576 | s676176658 | Accepted | import math
n,x,t = map(int,input().split())
c = math.ceil(n/x)
print(t*c) |
p03127 | s759819982 | Accepted | def gcd(a,b):
while b!=0:
a,b=b,a%b
return a
N=int(input())
# A=list(map(int,input().split()))
A=[int(i) for i in input().split()]
m=0
for a in A:
m=gcd(a,m)
print(m) |
p03803 | s412565276 | Wrong Answer | A, B =map(int, input().split())
if A==1:
A=14
if B==1:
B=14
print("Alice" if A>B else "Bob" if B<A else "Draw") |
p03371 | s227744398 | Accepted | import math
import itertools
import numpy as np
def solve():
a, b, c, x, y = map(int, input().split())
case1 = a * x + b * y
case2 = x * 2 * c + max(0, (y - x) * b)
case3 = max(0, (x - y) * a) + y * 2 * c
case4 = max(x, y) * 2 * c
print(min(case1, case2,case3,case4))
return 0
if __name__ ... |
p03105 | s926155974 | Accepted | A, B, C = map(int, input().split())
if B//A < C:
print(B//A)
else:
print(C) |
p02660 | s775580929 | Accepted | n = int(input())
r = 0
for p in range(2, int(n**0.5)+1):
e = 0
while n%p == 0:
e += 1
n /= p
i = 1
while e >= i:
e -= i
r += 1
i += 1
if n != 1:
r += 1
print(r) |
p04031 | s155110176 | Accepted | import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))
res = []
for num in range(-100, 101):
candidate = (A-num)**2
res.append(candidate.sum())
print(min(res)) |
p02744 | s157723308 | Accepted | N = int(input())
alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
def dfs(st, n, k):
if n == N:
print(st)
else:
for i in range(k+1):
if i < k:
dfs(st + alph[i], n+1, k)
else:
dfs(st + alph[i], n+1, k+1)
dfs("", 0, 0) |
p02554 | s543609639 | Accepted | def func(x, n):
res = 1
for _ in range(n):
res = res * x % MOD
return res
n = int(input())
MOD = 10**9 + 7
ans = func(10, n) - func(9, n) - func(9, n) + func(8, n)
ans %= MOD
print(ans)
|
p02725 | s363609732 | Wrong Answer | k,n = map(int,input().split())
a = list(map(int,input().split()))
l = []
l.append(abs(k-abs(a[0]-a[n-1])))
for i in range(n-1):
l.append(abs(a[i]- a[i+1]))
print(l) |
p03673 | s894212012 | Accepted | n = int(input())
a_list = [int(x) for x in input().split()]
if n % 2 == 0:
b_list = a_list[n-1::-2] + a_list[0::2]
else:
b_list = a_list[n-1::-2] + a_list[1::2]
print(*b_list) |
p02665 | s461496049 | Accepted | n,*a=map(int,open(0).read().split());t,w=sum(a),1;w=1;print(sum([1]+[exit(print(-1)) if(w:=min(2*(w-q),t:=t-q))<0 else w for q in a])) |
p02785 | s851293608 | Wrong Answer | n, k = map(int, input().split())
h = list(map(int, input().split()))
if n <= k:
print(0)
elif k == 0:
print(sum(h))
else:
h.sort()
print(h[:-k])
print(sum(h[:-k]))
|
p02836 | s004417149 | Accepted | a = input()
c = len(a) // 2
if len(a) % 2 == 0:
x = a[:c]
y = a[c :]
z = y[::-1]
else:
x = a[:c]
y = a[c + 1:]
z = y[::-1]
ans = 0
for i in range(len(a)//2):
if x[i] != z[i]:
ans += 1
print(ans)
|
p02860 | s444369073 | Accepted | N = int(input())
S = input()
if(len(S)%2==0):
if(S[:len(S)//2]==S[len(S)//2:]):
print('Yes')
else:
print('No')
else:
print('No') |
p03331 | s321776747 | Wrong Answer | import sys
input = sys.stdin.readline
def main():
N = int(input())
ans = float("inf")
for A in range(1, N - 2):
B = N - A
total = sum(int(s) for s in str(A)) + sum(int(s) for s in str(B))
if total < ans:
ans = total
print(ans)
if __name__ == "__main__":
mai... |
p03219 | s791773025 | Accepted | X, Y = map(int, input().split())
print(X+Y//2) |
p03592 | s578359853 | Accepted | import sys
N, M, K = map(int,input().split())
for m in range(N+1):
for n in range(M+1):
if m*M + n*N - 2*m*n == K:
print("Yes")
sys.exit()
print("No") |
p03804 | s213173314 | Accepted | n, m = map(int, input().split())
a = list()
for _ in range(n):
a.append(str(input()))
b = list()
for _ in range(m):
b.append(str(input()))
for H in range(n if m == 1 else n-m+1):
for W in range(n if m == 1 else n-m+1):
cnt = 0
for M in range(m):
if a[H+M][0+W:m+W] == b[M]:
... |
p02678 | s480461817 | Accepted | from collections import deque
n,m = map(int, input().split())
dic = {}
for i in range(m):
a,b = map(int,input().split())
dic.setdefault(a,[])
dic.setdefault(b,[])
dic[a].append(b)
dic[b].append(a)
array = [-1] * (n+1)
d = deque()
d.append(1)
while len(d) != 0:
tmp = d.popleft()
arr = dic.get(tmp... |
p03625 | s007902266 | Accepted | n = int(input())
a = list(map(int,input().split()))
ans = []
a.sort(reverse=True)
key = a[0]
i = 1
while True:
if i > n-1:
break
if len(ans) == 2:
break
if a[i] == key:
i += 1
ans.append(key)
if i > n-1:
break
key = a[i]
else:
key = a[i... |
p02606 | s458935072 | Accepted | import math
count = 0
L,R,d = list(map(int,input().split()))
c = math.ceil(L/d)
p = math.floor(R/d)
print(p-c+1) |
p02645 | s397210893 | Accepted | S = input()
print(S[0:3]) |
p03799 | s590321792 | Accepted | N, M = map(int, input().split())
S = N
c = M // 2
print(min((S + c) // 2, c)) |
p02723 | s359915024 | Accepted | s=input()
print("Yes" if s[2]==s[3] and s[4]==s[5] else "No") |
p03352 | s303846006 | Accepted | MAX = 35
N = int(input())
ans = 1
for i in range(2,MAX+1):
t = i*i
while t <= N:
ans = max(ans,t)
t *= i
print(ans)
|
p03695 | s811969971 | Wrong Answer | N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(sorted(set(A)))
if 8 in A:
A.remove(8)
sum = len(A)
if sum > cnt8:
print(sum, end=' ')
else:
print(cnt8, end=' ')
sum += cnt8
if sum > 8:
print(8)
else... |
p02971 | s949636777 | Wrong Answer | n = int(input())
A = []
maximum = 0
maximum_idx = 0
for i in range(n):
a = int(input())
A.append(a)
if a > maximum:
maximum = a
maximum_idx = i
for i in range(n):
if i != maximum_idx:
print(maximum)
else:
print(sorted(A)[1])
|
p04020 | s562950396 | Wrong Answer | n = int(input())
a = [int(input()) for _ in range(n)]
dp = [0] * n
dp[0] = a[0] // 2
for i in range(1, n):
if dp[i] < dp[i-1] + a[i] // 2:
dp[i] = dp[i-1] + a[i] // 2
if dp[i] < min(a[i-1], a[i]):
dp[i] = min(a[i-1], a[i])
a[i] -= min(a[i-1], a[i])
print(dp[-1])
|
p03705 | s290543042 | Wrong Answer | import sys
n, a, b = map(int, input().split())
if a >= b:
print(0)
sys.exit()
if n < 2:
print(0)
sys.exit()
print((b-a)*(n-2)+1) |
p03672 | s815605908 | Wrong Answer | s = input()
length = len(s)
maxlen = 0
for i in range(length//2-1):
if s[0:(i+1)] == s[(i+1):2*(i+1)]:
maxlen = 2*i
print(maxlen)
|
p03672 | s863979516 | Accepted | if __name__ == '__main__':
s = input()
for i in range(1,len(s)):
s2 = s[:len(s)-i]
count =0
if len(s2) % 2 ==0:
for j in range(len(s2)// 2):
if s2[j] == s2[len(s2)// 2 + j]:
count+=1
if count == len(s2)//2:
pri... |
p03338 | s493044951 | Accepted | n = int(input())
s = input()
count = 0
ans = 0
for i in range(0, n - 1):
x = list(s[:i + 1])
y = list(s[i + 1:])
for c in range(ord('a'), ord('z') + 1):
if chr(c) in x and chr(c) in y:
count += 1
if ans < count:
ans = count
count = 0
print(ans) |
p02618 | s924347854 | Accepted | d =int(input())
c = list(map(int, input().split()))
s = []
t = []
d_l = []
score = 0
soft = 0
for i in range(d):
s.append(0)
s[i] = list(map(int, input().split()))
for i in range(26):
d_l.append(0)
for i in range(d):
t_max = max(s[i])
t = s[i].index(t_max)
print(t + 1)
|
p02796 | s864335073 | Wrong Answer | n = int(input())
X = [list(map(int,input().split())) for _ in range(n)]
X.sort()
right = X[0][0]+X[0][1]
ans = n
for i in range(1,n):
left = X[i][0]-X[i][1]
if left < right:
ans -= 1
else:
right = left
print(ans) |
p03767 | s907547814 | Accepted | n = int(input())
print(sum(sorted(list(map(int, input().split())))[n::2])) |
p02718 | s500130349 | Accepted | N,M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
A.sort(reverse=True)
if (A[M-1] * 4 * M) < S:
print('No')
else:
print('Yes') |
p03997 | s348464550 | Accepted | a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2)) |
p03474 | s608426313 | Accepted | A,B=map(int,input().split())
S=input()
num=[str(k) for k in range(10)]
for i in range(A):
if S[i] not in num:
print('No')
exit()
if S[A]!='-':
print('No')
exit()
for j in range(A+1,A+B):
if S[j] not in num:
print('No')
exit()
print('Yes')
|
p02854 | s310948592 | Accepted | #!/usr/bin/env python
# coding: utf-8
# In[15]:
N = int(input())
A = list(map(int, input().split()))
# In[17]:
total = sum(A)
ans = total
left = 0
for i in A:
left += i
right = total - left
ans = min(ans, abs(left - right))
# print(left, right, ans)
print(ans)
# In[ ]:
|
p02879 | s581303382 | Accepted | a,b = map(int,input().split())
if a < 10 and b < 10:
print(a*b)
else:
print(-1) |
p02694 | s878119083 | Accepted | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from math import floor
def main():
x = int(readline())
a = 100
i = 0
while a < x:
a = floor(a*(1.01))
i+=1
print(i)
if __name__ == '__main__':
main()
|
p03131 | s030587877 | Wrong Answer | k,a,b = map(int,input().split())
dif = b-a
if b<=2:
print(k)
else:
ans = dif*(k//2)
ans += (k%2==1)
print(ans) |
p02838 | s722070212 | Accepted | import sys
input = sys.stdin.readline
def main():
n=int(input())
#a=list(map(lambda x:list(map(int,list(bin(int(x))[2:]))),input().split()))
a=list(map(int,input().split()))
mod=pow(10,9)+7
bit=[0]*61
for ai in a:
for j in range(61):
if ((ai>>j)&1):
bit[j]+=1
ans=0
for i in range(61):#... |
p03785 | s381025330 | Wrong Answer | import sys
import bisect
input = sys.stdin.readline
n, c, k = [int(w) for w in input().split()]
la = [int(input()) for _ in range(n)]
la.sort()
lak = [a + k for a in la]
ind = 0
ans = 0
while ind < n:
ride = bisect.bisect_right(la, lak[ind]) - ind
ind += min(ride, k)
ans += 1
print(ans)
|
p02860 | s809063983 | Wrong Answer | N = int(input())
S = str(input())
cnt=0
if N%2==1:
print('No')
else:
for i in range(int(N/2)):
if S[i]==S[int(N/2)+i]:
cnt+=1
else:
print('No')
break
if cnt==int(N/2):
print('Yes') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.