problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02700 | s017900225 | Accepted | a,b,c,d = map(int,input().split())
a2 = a
c2 = c
while True:
c2-=b
if c2 <= 0:
print('Yes')
exit()
a2-=d
if a2 <= 0:
print('No')
exit() |
p02759 | s865473971 | Wrong Answer | print(int(input()) // 2)
|
p03478 | s218884905 | Accepted | n, a, b = map(int, input().split())
ans = 0
for i in range(1, n + 1):
su = sum(map(int, list(str(i))))
if a <= su <= b:
ans += i
print(ans) |
p03767 | s147605406 | Accepted | N = int(input())
lis = list(map(int, input().split()))
lis.sort(reverse=True)
lis = lis[1::2]
ans = 0
for i in range(N):
ans += lis[i]
print(ans)
|
p03387 | s319151129 | Accepted | a, b, c = map(int, input().split())
answer = 0
while not (a == b == c):
a, b, c = sorted([ a, b, c ])
if a + 2 <= c:
a += 2
else:
a += 1
b += 1
answer += 1
print(answer) |
p02842 | s916320337 | Wrong Answer | N = int(input())
S = int(N / 1.08)
if S * 1.08 < N or S * 1.08 >= N + 1:
print(":(")
else:
print(S)
|
p02963 | s694882521 | Accepted | s = int(input())
if round(s**0.5)**2==s:
tmp = round(s**0.5)
print(0, 0, tmp, 0, 0, tmp)
exit()
i = int(s**0.5)+1
for j in range(i, 0, -1):
if i*j<s:
print(0, 0, i, 1, i*(j+1)-s, j+1)
break |
p02615 | s465705426 | Accepted | N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans=0
import heapq
hq=[]
for i in range(N):
if i==0:
heapq.heappush(hq,-A[i])
continue
else:
tmp=heapq.heappop(hq)*-1
ans+=tmp
heapq.heappush(hq,-A[i])
heapq.heappush(hq,-A[i])
print(ans) |
p03723 | s031470468 | Accepted | a,b,c = map(int,input().split(' '))
ans = 0
if a % 2 == 0 and a == b and a == c:
ans = -1
elif (a+1)*(b+1)*(c+1)%2 == 0:
ans = 0
else:
A = [a,b,c]
A.sort()
a1 = A[2]-A[1]
a2 = A[1]-A[0]
ans = 0
while a1%2 == 0 and a2%2 == 0:
ans += 1
a1 /= 2
a2 /= 2
print(ans) |
p03359 | s976387187 | Accepted | a, b = map(int, input().split())
if a <= b:
print(a)
else:
print(a-1) |
p03803 | s758550020 | Accepted |
ab=[int(i) for i in input().split()]
for i in range(2):
if ab[i]==1:
ab[i]+=13
print("Alice" if ab[0]>ab[1] else "Draw" if ab[0]==ab[1] else "Bob")
|
p03986 | s080906788 | Accepted | x=input()
l=[]
for i in x:
if len(l)>0 and l[-1]=='S' and i=='T':
l.pop()
continue
l.append(i)
print(len(l)) |
p02707 | s400759288 | Wrong Answer | N = int(input())
A = input()
S = A.replace(' ','a')
for i in range(N):
j = str(i+1) + 'a'
k = S.count(j)
print(k)
|
p02911 | s137835912 | Wrong Answer | from collections import defaultdict
n,k,q = map(int,input().split())
l = [int(input()) for _ in range(q)] #複数行1文字をintでリストに
d = defaultdict(int)
for i in l:
if i in d:
d[i] += 1
else:
d[i] =1
for i in range(n):
a = q-d[i]
b = k-a
if b >=0:
print("Yes")
else:
print... |
p02612 | s117552433 | Accepted | # coding: utf-8
# 日本語を入力できるようにするために上記一文が必要
N = int(input())
chash = 0
while chash < N:
chash += 1000
print(chash - N ) |
p02911 | s561595024 | Accepted | N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
correct = [0] * N
for a in A:
correct[a-1] += 1
hp = Q - K
for i in range(N):
if correct[i] > hp:
print("Yes")
else:
print("No") |
p04005 | s413228433 | Accepted | A,B,C = map(int, input().split())
if A%2==0 or B%2==0 or C%2==0:
print(0)
else:
print(min(A*B,B*C,C*A)) |
p02601 | s050508249 | Accepted | A, B, C = map(int, input().split())
K = int(input())
while B <= A:
B *= 2
K -= 1
while C <= B:
C *= 2
K -= 1
if K >= 0:
print("Yes")
else:
print("No") |
p02983 | s260231187 | Accepted | L,R=map(int,input().split())
ans=2020
if R-L>=2019:
ans=0
else:
for i in range(L,R+1):
for j in range(i+1,R+1):
a=(i*j)%2019
ans=min(ans,a)
print(ans) |
p02694 | s943300191 | Accepted | import math
x=int(input())
p=100
cnt=0
while x>p:
p+=p//100
cnt+=1
print(cnt)
|
p03827 | s595235279 | Wrong Answer | n=int(input())
s=input()
x=0
y=0
for i in range(n-1):
if (s[i]=="I"):
x+=1
y=max(x,y)
else:
x-=1
print(y) |
p03773 | s992692761 | Wrong Answer | a=sum(map(int,input().split()))
print(a if a<=24 else a-24) |
p03478 | s456897779 | Accepted | def calc_sum(num):
ans = 0
for i in range(len(str(num))):
target = num % 10
num //= 10
ans += target
return ans
def main():
n, a, b = map(int, input().split())
ans = 0
for i in range(1, n + 1):
num = calc_sum(i)
if a <= num <= b:
ans += i
... |
p02552 | s405743667 | Accepted | print((int(input())+1)%2) |
p04033 | s103685637 | Wrong Answer | import sys
a,b = map(int,input().split())
c = 0
if a < 0 and b < 0:
if a-b % 2 == 0:
print("Positive")
sys.exit()
elif a < 0 and b >= 0:
if a%2 == 0:
print("Positive")
sys.exit()
elif a < 0 and b >= 0:
if b % 2 == 0:
print("Positive")
sys.exit()
if (a+b) == 0... |
p02726 | s690365981 | Wrong Answer | N, X, Y = map(int, input().split())
print('\n'.join(map(str, [sum([[(j-i)-(Y-X)+1 if i<=X<Y<=j else (j-i) for j in range(1, N+1) if i<j] for i in range(1, N+1)], []).count(k) for k in range(1, N)]))) |
p02624 | s107195737 | Accepted | N = int(input())
counter = 0
for n in range(1,N+1):
a = N//n
counter += a*(a+1)*n//2
print(counter) |
p02642 | s922549169 | Accepted | N = int(input())
A = list(map(int, input().split()))
l = [0] *(10**6+1)
for i in range(N):
num = A[i]
if l[num] != 0:
l[num] = 2
continue
for j in range(num, 10**6+1, num):
l[j] += 1
ans = 0
for i in range(N):
num = A[i]
if l[num] == 1:
ans += 1
print(ans)
|
p02970 | s203514332 | Accepted | n, d = map(int, input().split())
d = 2 * d + 1
print((n + d - 1) // d) |
p03815 | s076503427 | Accepted | x = int(input())
q = x // 11
ans = q * 2
if x % 11 == 0:
print(ans)
elif x - q * 11 <=6:
print(ans+1)
else:
print(ans+2)
|
p02646 | s783947753 | Accepted | A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
dist = abs(A-B)
v = V-W
if T*v>=dist:print('YES')
else:print('NO') |
p02924 | s157733059 | Accepted | import sys
import math
import itertools
n = int(input())
if(n%2==0):
print((n + 1) * (n // 2) - n)
else:
print((n + 1) * ((n-1) // 2) +(n+1)//2- n) |
p02570 | s775341089 | Accepted | d,t,s=map(int,input().split())
x=d/s
if x<=t:
print("Yes")
else:
print("No") |
p02694 | s638864830 | Wrong Answer | x = int(input())
money = 100
ans = 0
while money <= x:
money = int(money*1.01)
ans += 1
print(ans) |
p02881 | s592103199 | Accepted | import math
n = int(input())
root_n = math.floor(math.sqrt(n))
ans = 0
for i in range(1,root_n+1):
if n % i ==0:
ans = i
print(int(ans + n/ans -2)) |
p03380 | s066322292 | Accepted | n=int(input())
a=list(map(int,input().split()))
b=max(a)
d=b/2
c=abs(d-a[0])
#print(c)
if a[0]==b:
c=99999
ans=a[0]
for i in a:
#print(abs(i-d))
if i==b:
continue
if abs(i-d)<c:
ans=i
c=abs(i-d)
print(b,end=" ")
print(ans) |
p02933 | s603079971 | Accepted | a = int(input())
s = input()
print(s) if a >= 3200 else print("red") |
p03637 | s914595816 | Wrong Answer | import sys
N = int(input())
*A, = map(int, input().split())
count = 0
for a in range(len(A)):
if A[a]%4==0:
count = count + 1
if N<3:
if count>=1:
print("Yes")
sys.exit()
else:
print("No")
sys.exit()
num4 = (N//3)
if (N%3)!=0:
num4 = num4 + 1
if num4<=count:
... |
p03799 | s753442115 | Wrong Answer | N,M = map(int, input().split())
ans = 0
if N<=M:
ans = N
M = max(0, M-2*N)
ans = ans + M//4
print(ans)
else:
print(M//2) |
p02717 | s886229047 | Wrong Answer | a=list(map(int,input().split()))
n=a[1]
a[1]=a[0]
a[0]=a[2]
a[2]=n
print (a) |
p03774 | s151902612 | Wrong Answer | N, M = map(int, input().split())
ab = [list(map(int,input().split())) for i in range(N)]
cd = [list(map(int,input().split())) for i in range(M)]
for i in range(N):
check = 10**5
ans = 51
for j in range(M):
if abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]) < check:
ans = j+1
... |
p02862 | s692386366 | Accepted | X, Y = map(int, input().split())
n, mod = divmod(X + Y, 3)
def modinv(a, mod=10 ** 9 + 7):
return pow(a, mod - 2, mod)
def combination(n, r, mod=10 ** 9 + 7):
r = min(r, n - r)
res = 1
for i in range(r):
res = res * (n - i) * modinv(i + 1, mod) % mod
return res
if mod != 0 or not (X <=... |
p03331 | s013270876 | Accepted | N = int(input())
def d_sum(n):
ret = 0
while(n>0):
ret += n%10
n //= 10
return ret
ans = N
for i in range(1, N//2+2):
ans = min(ans, d_sum(i)+d_sum(N-i))
print(ans)
|
p03605 | s814481423 | Accepted | n = str(input())
if n[0] == "9" or n[1] == "9":
print("Yes")
else:
print("No") |
p03472 | s594644062 | Accepted | import math
N, H = map(int, input().split())
a_list = []
b_list = []
for i in range(N):
a, b = map(int, input().split())
a_list.append(a)
b_list.append(b)
max_a = max(a_list)
b_list.sort(reverse=True)
count = 0
for b in b_list:
if b > max_a and H > 0:
count += 1
H -= b
else:
... |
p02882 | s932980084 | Accepted | import math
a,b,x = map(int,input().split())
if x<=(a**2*b)/2:
deg = math.degrees(math.atan((a*b**2)/(2*x)))
else:
deg = math.degrees(math.atan(2*(b*a**2-x)/a**3))
print(deg) |
p03699 | s358369330 | Wrong Answer | n = int(input())
s = []
for i in range(n):
s += [int(input())]
if sum(s) % 10 != 0:
print(sum(s))
else:
a = []
for i in range(n):
a += [s[i]]
if sum(s) - sum(a) % 10 != 0:
print(sum(s) - sum(a))
exit() |
p02951 | s552170001 | Wrong Answer | a, b, c = map(int, input().split())
print(c -(a-b)) |
p03665 | s665174082 | Wrong Answer | N,P = map(int, input().split())
A = list(map(int, input().split()))
in_odd = False
for i in range(N):
if A[i]%2:
in_odd = True
break
if (not in_odd and P == 1):
print(0)
else:
print(2**(N-1)) |
p03625 | s252632664 | Accepted | n = int(input())
a = sorted(list(map(int, input().split())), reverse=True) + [0, 0, 0, 0]
l = []
for i in range(len(a) - 1):
if a[i] == a[i + 1] and (len(l) == 0 or l[-1] != i - 1):
l.append(i)
if len(l) >= 2:
break
print(a[l[0]] * a[l[1]])
|
p03293 | s161093008 | Wrong Answer | from collections import deque
s = input()
t = input()
t = deque(t)
for i in range(len(s)):
if s=="".join(t):
print("Yes")
exit()
t.append(t.popleft()) |
p03456 | s439485869 | Accepted | a,b = input().split()
c = a+b
w = False
for i in range(int(c)):
if i*i == int(c):
print("Yes")
w = True
break
if w == False:
print("No") |
p02972 | s603740913 | Wrong Answer | n = int(input())
a = [0]+list(map(int,input().split()))
x = [0]*(n+1)
for i in range(n,0,-1):
buf = 0
for j in range(1,n//i+1):
buf += x[i*j]
if buf!=a[i]:x[i]=1
x = x[1:]
m = 0
b = []
for i in range(n):
if x[i]==1:
b.append(i+1)
m+=1
print(m)
print(*b)
|
p03254 | s729251477 | Accepted | n, y = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
ans = 0
if y == sum(a):
ans = n
elif y > sum(a):
ans = n -1
else:
for i in range(n):
if y - a[i] >= 0:
y -= a[i]
ans += 1
else:
break
print(ans) |
p02683 | s319037703 | Accepted | n, m, x = map(int, input().split())
ca = [list(map(int, input().split())) for i in range(n)]
ans = 1e18
for i in range(1<<n):
cost = 0
udst = [0] * m
for j in range(n):
if((i>>j)&1):
cost += ca[j][0]
for k in range(m):
udst[k] += ca[j][k+1]
ok = True
f... |
p03607 | s184326548 | Wrong Answer | ans = 0
n = int(input())
l = [int(input()) for _ in range(n)]
l.sort()
c = 1
if n > 1:
for i in range(n-1):
if l[i] == l[i+1]:
c += 1
else:
if c%2 != 0:
ans += 1
c = 1
if l[-2] != l[-1]:
ans += 1
else:
ans = 1
print(ans) |
p03331 | s513191700 | Accepted | n = int(input())
ans = float('inf')
for i in range(1, n):
a = i
b = n-i
m = len(str(a))
l = len(str(b))
cnt = 0
for j in range(m):
cnt += int(str(a)[j])
for j in range(l):
cnt += int(str(b)[j])
ans = min(ans, cnt)
print(ans)
|
p03067 | s262590500 | Wrong Answer | a,b,c=map(int,input().split())
print('No') if c>(a and b) or c<(a and b) else print('Yes') |
p02873 | s661429857 | Accepted |
S = input()
List=[0]*(len(S)+1)
i=0
while i<len(S):
if S[i]=="<":
List[i+1]=List[i]+1
i+=1
j=1
while j<=len(S):
if S[-j]==">":
List[-(j+1)]=max(List[-j]+1,List[-(j+1)])
j+=1
print(sum(List)) |
p03037 | s776630076 | Wrong Answer | n, m = map(int, input().split())
s = [0] * (n+2)
for i in range(m):
l, r = map(int, input().split())
s[l-1] += 1
s[r] -= 1
ans = [0] * (n+2)
for i in range(1, n+2):
ans[i] = ans[i-1] + s[i]
print(ans.count(max(ans))) |
p03494 | s520352983 | Accepted | N = int(input())
l = list(map(int, input().split()))
counter = 0
flag = 1
while flag == 1:
for i in range(len(l)):
if l[i] % 2 != 0:
flag = 0
break
else:
l[i] = int(l[i] / 2)
if flag == 1:
counter += 1
print(counter) |
p03632 | s950334492 | Accepted | def readinput():
a,b,c,d=map(int,input().split())
return a,b,c,d
def main(a,b,c,d):
l=max(a,c)
r=min(b,d)
return max(r-l,0)
if __name__=='__main__':
a,b,c,d=readinput()
ans=main(a,b,c,d)
print(ans)
|
p02696 | s091407065 | Wrong Answer | a, b, n = map(int, input().split())
def calc(x):
# print(a, b, x)
return (a*x)//b - a*(x//b)
res = 0
for i in range(0, min(a + 5, n + 1)):
# print(i)
# print(calc(i))
res = max(res, calc(i))
# print(res)
print(res) |
p02916 | s704548628 | Wrong Answer | n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
c.append(0)
c[a[n-1]-1] = 0
ans = 0
for i in a:
ans += b[i-1] + c[i-1]
print(ans)
|
p03799 | s813420510 | Accepted | # coding: utf-8
n, m = map(int, input().split())
ans = 0
# 最初のs使いきれるか
if 2 * n >= m:
print(min(n, m // 2))
else:
ans += n
m -= 2 * n
ans += m // 4
print(ans)
|
p02832 | s023125799 | Wrong Answer | #初期入力
import sys
N = int(input())
A=[int(i) for i in input().split()]
#
i=2 #探す「文字」
brick_remain =set()
if 1 not in A:
print(-1)
exit
else:
brick_remain.add(1)
for a in A:
if a ==i:
brick_remain.add(a)
i +=1
brick_destroy = N - len(brick_remain)
print(bric... |
p03239 | s493085024 | Wrong Answer | n, tl = [int(x) for x in input().split()]
c_init = 10 * 4
ans = c_init
for _ in range(n):
c, t = [int(x) for x in input().split()]
if t <= tl and ans > c:
ans = c
if ans == c_init:
ans = "TLE"
print(ans) |
p03208 | s223977389 | Accepted | N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]
H.sort()
ans = 10 ** 18
for i in range(N - K + 1):
h1 = H[i]
h2 = H[i + K - 1]
ans = min(ans, h2 - h1)
print(ans) |
p03456 | s681236053 | Accepted | a, b = input().split()
s = int(a+b)
result = 'No'
for i in range(1,round(s)):
if s/i == i:
result = 'Yes'
print(result) |
p02836 | s626345126 | Accepted | s=input()
t=s[::-1]
n=len(s)
num=n//2
count=0
for i in range(num):
if s[i]!=t[i]:
count+=1
print(count) |
p03759 | s470768872 | Accepted | # -*- coding: utf-8 -*-
a,b,c = map(int, input().split())
if b-a == c-b:
print('YES')
else:
print("NO") |
p02833 | s323014861 | Accepted | N = int(input())
hoge = []
if N % 2 != 0:
print(0)
else:
for i in range(1, 27):
hoge.append((N // 10) // (5 ** i))
print(sum(hoge) + (N // 10))
|
p02694 | s312155490 | Accepted | import sys
X = int(sys.stdin.readline().strip())
p = 100
ans = 0
while p < X:
p = int(p * 1.01)
ans += 1
print(ans) |
p03495 | s912961981 | Accepted | n, k = map(int, input().split())
from collections import Counter
c = Counter(list(map(int, input().split())))
#Counterからの取り出し
l = []
m = []
for x, y in c.items():
l += [y]
m += [x]
L = sorted(l)
M = len(m)
cnt = 0
if M <= k:
print(0)
else:
for i in range(M-k):
cnt += L[i]
print(cnt) |
p02639 | s503485509 | Wrong Answer | x = list(map(int, input().split()))
counter = 0
for i in x:
counter += 1
if x == 0:
print(counter) |
p02615 | s197725636 | Accepted | n= int(input())
n -= 1
arr= sorted(list(map(int,input().split())))[::-1]
ans = arr[0]
i = 1
while n > 1:
if n > 2:
ans += arr[i]*2
i += 1
n -= 2
elif n ==2:
ans += arr[i]
break
print(ans) |
p02854 | s299060399 | Wrong Answer | N = int(input())
A = list(map(int,input().split()))
if N%2 == 0:
print(abs(sum(A[N//2:])-sum(A[:N//2])))
else:
sum1 = sum(A[N//2:]) - sum(A[:N//2])
sum2 = sum(A[N//2+1:]) - sum(A[:N//2+1])
print(min(abs(sum1),abs(sum2))) |
p03000 | s729650796 | Wrong Answer | inputted = list(map(int, input().split()))
N = inputted[0]
X = inputted[1]
L = list(map(int, input().split()))
x = 0
number_of_bounds = 0
for _i, Li in enumerate(L):
x += Li
number_of_bounds = _i + 1
if x > X: break
print(number_of_bounds)
|
p04012 | s808241076 | Accepted | w = input()
for i in range(len(w)):
if w.count(w[i:i+1]) % 2 != 0:
print('No')
exit()
print('Yes')
|
p03438 | s809592181 | Wrong Answer | N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
countA,countB = 0,0
for i in range(N):
if A[i] <= B[i]:
countA += (B[i]-A[i])/2
else:
countB += A[i]-B[i]
if sum(B)-sum(A) >= max(countA,countB):
ans = "Yes"
else:
ans = "No"
print(ans) |
p03481 | s751396431 | Accepted | x,y = map(int,input().split())
ans = 0
while x <= y:
x *= 2
ans += 1
print(ans) |
p02842 | s867700654 | Accepted | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
N = int(input())
import math
lower = math.floor(N / 1.08)
upper = math.ceil(N / 1.08)
if math.floor(lower * 1.08) == N:
print(lower)
elif math.floor(upper * 1.08) == N... |
p03448 | s181906130 | Accepted | a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(0,a+1):
for j in range(0,b+1):
for k in range(0,c+1):
if (i*500+j*100+k*50==x):
ans+=1
break
elif (i*500+j*100+k*50>x):
break
print(ans) |
p02854 | s979808941 | Accepted | # Problem B - Iron Bar cutting
# input process
N = int(input())
a_list = list(map(int, input().split()))
# initialization
min_cost = 10**18
left_sum = 0
right_sum = sum(a_list)
# count process cumulative sum
for i in range(N-1):
left_sum += a_list[i]
right_sum -= a_list[i]
distance = abs(left_sum - right... |
p02791 | s720616112 | Accepted | import sys
input = sys.stdin.readline
N=int(input())
P = list(map(int,input().split()))
cnt=1
M=P[0]#現在の最小値
for i in range(1,N):
if(M > P[i]):#Pの値が現在の最小値より小さかったら最小値を更新しcnt++する
M=P[i]
cnt+=1
print(cnt)
|
p03323 | s047730400 | Accepted | a,b=map(int,input().split())
print('Yay!' if a<=8 and b<=8 else ':(') |
p03723 | s773466785 | Accepted | a,b,c=map(int,input().split())
cnt=0
if a==b==c and a%2==0:
print(-1)
else:
while a%2==0 and b%2==0 and c%2==0:
a,b,c=(b+c)//2,(a+c)//2,(a+b)//2
cnt+=1
print(cnt)
|
p02982 | s451803285 | Accepted | N, D = map(int, input().split())
X = []
for i in range(N):
X.append(list(map(int, input().split())))
#print(X)
ans = 0
for i in range(N):
for j in range(i+1, N):
dist_sq = 0
for x, y in zip(X[i], X[j]):
dist_sq += (x - y) ** 2
dist = dist_sq ** 0.5
#print(i, j, dist)
if dist - int(dist)... |
p02818 | s616821095 | Accepted | A, B, K = map(int, input().split())
if A > K:
A -= K
else:
K -= A
A = 0
B -= K
if B < 0:
B = 0
print(A,B) |
p02571 | s854245612 | Accepted | S=input()
T=input()
NS=len(S)
NT=len(T)
ans=pow(10,9)
for n in range(NS-NT):
suuji=0
for m in range(NT):
if S[n+m]!=T[m]:
suuji+=1
ans=min(ans,suuji)
if NS==NT:
suuji=0
for n in range(NS):
if S[n]!=T[n]:
suuji+=1
ans=min(suuji,ans)
print(ans)
|
p03815 | s788073242 | Wrong Answer | x = int(input())
count_11 = x // 11
count_11 *= 2
remainder = x % 11
if remainder > 6:
count_11 += 2
else:
count_11 += 1
print(count_11) |
p02773 | s403744443 | Accepted | n=int(input())
a=[]
d={}
b=0
m=0
for i in range(n):
s=input()
try:
a[d[s]][1]+=1
except:
d[s]=b
a.append([s,1])
b+=1
m=max(m,a[d[s]][1])
a.sort()
for i in range(len(a)):
if a[i][1]==m:
print(a[i][0]) |
p03493 | s509364451 | Accepted | import sys
import math
import bisect
def main():
ans = 0
for c in input():
if c == '1':
ans += 1
print(ans)
if __name__ == "__main__":
main()
|
p02725 | s420205615 | Wrong Answer | k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = [0] + a + [k[0]]
sa = [b[i + 1] - b[i] for i in range(len(b) - 1)]
c = sa[1:-1]
if k[1] % 2 == 1:
temae = (len(sa) // 2) -1
oku = temae + 1
d = sum(sa) - sa[temae]
e = sum(sa) - sa[oku]
print(min([sum(c), d, e]))
else:
x = len(sa) /... |
p03386 | s340247869 | Accepted | a, b, k = map(int, input().split())
for i in range(a, min(b, a + k - 1) + 1):
print(i)
for i in range(max(b - k + 1, a + k), b + 1):
print(i)
|
p03799 | s617281582 | Accepted | N,M=map(int,input().split())
print(min((N *2+M)//4,M//2)) |
p02603 | s356332789 | Accepted | N=int(input())
alist=list(map(int,input().split()))
money=1000
kabu=0
for i in range(N-1):
if alist[i]<alist[i+1]:
#buy as possible
k=money//alist[i]
kabu+=k
money-=k*alist[i]
elif alist[i]>alist[i+1]:
#sell all
money+=alist[i]*kabu
kabu=0
money+=alist[N-1]*kabu
print(money) |
p02801 | s090793056 | Wrong Answer | c=input()
print("c+1") |
p02784 | s590427416 | Accepted | #!/usr/bin/env python
# -*- coding: utf-8 -*-
h, n = map(int, input().split())
a_list = list(map(int, input().split()))
sum_a = 0
for a in a_list:
sum_a += a
if h <= sum_a:
print("Yes")
else:
print("No") |
p03478 | s073889888 | Accepted | N,A,B=map(int,input().split())
ans=0
for i in range(1,N+1):
a=str(i)
b=0
for j in range(len(a)):
b+=int(a[j])
if A<=b<=B:
ans+=i
print(ans) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.