problem_id stringclasses 428 values | submission_id stringlengths 10 10 | status stringclasses 2 values | code stringlengths 5 816 |
|---|---|---|---|
p03095 | s071515162 | Accepted | N = int(input())
S = input()
from collections import Counter
c = Counter(S)
p = 10**9 + 7
result = 1
for v in c.values():
result *= (v+1)
result %= p
print((result - 1) % p) |
p02691 | s177814873 | Wrong Answer | # -*- coding: utf-8 -*-
N = int(input())
A = [int(i) for i in input().split()]
ans = 0
for i in range(1,N-1):
k = 0
while(k+i<N):
#print(A[k], A[k+i],i)
if(A[k]+A[k+i]) == i:
ans += 1
k+=1
print(ans)
|
p02660 | s536408152 | Accepted | N = int(input())
ans = 0
f = 2
while True:
if N%f==0:
c = 0
while N%f==0:
N /= f
c += 1
n = 1
while n*(n+1)//2<=c:
n += 1
ans += n-1
if f*f>N:
break
f += 1
if N>1:
ans += 1
print(ans) |
p02714 | s091275178 | Wrong Answer | n = int(input())
s = input()
count = 0
for i in range(n-2):
lis = []
lis.append(s[i])
for j in range(i+1,n-1):
if not s[j] in lis :
lis.append(s[j])
for k in range(j+1,n):
if not s[k] in lis :
count += 1
print(count) |
p03434 | s103988757 | Wrong Answer | N=int(input())
A_list=list(map(int, input().split()))
A_list = sorted(A_list, reverse=True)
total = 0
for i in range((N+1)//2):
total = total + A_list[i*2]
print(total) |
p04044 | s506790555 | Wrong Answer | s = list(map(int, input().split()))
t = [input() for i in range(s[0])]
for i in range(0, s[0] - 1):
if t[i] > t[i + 1]:
u = t[i]
t[i] = t[i + 1]
t[i + 1] = u
v = t[0]
for i in range(1, s[0]):
v = v + t[i]
print(v) |
p04034 | s759469133 | Accepted | N, M = map(int, input().split())
y_if = {1}
num = [1] * N
for i in range(M):
x, y = map(int, input().split())
num[x - 1] -= 1
num[y - 1] += 1
if x in y_if:
if num[x - 1] == 0:
y_if.remove(x)
y_if.add(y)
print(len(y_if))
|
p02712 | s780515990 | Accepted | # coding: utf-8
N = int(input())
lst = [i+1 for i in range(N)]
i = 0
while (i < N):
if lst[i] % 3 == 0 and lst[i] % 5 == 0:
lst[i] = 0
elif lst[i] % 3 == 0:
lst[i] = 0
elif lst[i] % 5 == 0:
lst[i] = 0
i = i + 1;
print(sum(lst)) |
p03077 | s109896709 | Wrong Answer | import sys
from bisect import bisect_left,bisect_right,insort
input = sys.stdin.readline
def main():
n=int(input())
x=[int(input()) for _ in range(5)]
print(int(n//min(x)+5))
if __name__ == '__main__':
main() |
p02584 | s035278290 | Wrong Answer | x, k, d = map(int, input().split())
if x > k * d:
print(x - k * d)
elif x == k * d:
print(0)
else:
q = x // d
mod = x % d
k -= q
x -= q * d
r = abs(mod - d)
if k == 0:
print(abs(x))
elif k == 1:
print(abs(x-d))
elif k % 2 == 0:
print(mod)
else:
print(r)
|
p02759 | s815374363 | Wrong Answer | n = int(input())
if 1 <= n and n <= 100 :
if type(n/2) == int :
page = int(n/2)
elif type(n/2) == float :
page = int(n/2) + 1
print(page) |
p02684 | s542591274 | Accepted | N, K = map(int, input().split())
A = list(map(int, input().split()))
p = [-1] * N
p[0] = 0
flag = 0
now = 1
i = 0
while flag == 0:
i += 1
now = A[now - 1]
if p[now - 1] != -1:
flag = 1
else:
p[now - 1] = i
if i == K:
flag = 2
if flag == 2:
print(now)
else:
r = i - p[now - 1]
e = p[now - 1]
count = K - e
pi = count % r
for i in range(pi):
now = A[now - 1]
print(now) |
p03284 | s923460183 | Accepted | n,k = map(int, input().split())
if n % k == 0:
print(0)
else:
print(1) |
p04030 | s907710983 | Accepted | s=input()
lis=[]
for i in range(len(s)):
if s[i]=='0': lis.append('0')
elif s[i]=='1': lis.append('1')
elif s[i]=='B' and len(lis)==0: continue
else: lis=lis[:-1]
print(''.join(lis)) |
p02939 | s514742345 | Accepted | S = input()
A = [S[0]]
a = ""
for s in S[1:]:
a += s
if a != A[-1]:
A.append(a)
a = ""
print(len(A))
|
p03639 | s276189263 | Accepted | n = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
if a%4==0: cnt += 1
elif a%2==0: cnt += 0.5
cnt = int(cnt)
print("Yes" if n//2 <= cnt else "No") |
p02859 | s015013599 | Accepted | r = int(input())
print(r**2)
|
p02742 | s211386575 | Accepted | H, W = map(int, input().split())
if H == 1 or W == 1:
print(1)
else:
q,r = divmod(H*W, 2)
print(q+r) |
p02577 | s785130493 | Accepted |
s = input()
N = [int(c) for c in s]
ans = 0
for i in range(len(N)):
ans += N[i]
if ans%9==0:
print("Yes")
else:
print("No")
|
p03075 | s162122837 | Accepted | a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>k:print(':(')
else:print('Yay!') |
p02600 | s346581251 | Wrong Answer | x=int(input())
if(x<=400 and x>=599):
print("8")
elif(x<=600 and x>=799):
print("7")
elif(x<=800 and x>=999):
print("6")
elif(x<=1000 and x>=1199):
print("5")
elif(x<=1200 and x>=1399):
print("4")
elif(x<=1400 and x>=1599):
print("3")
elif(x<=1600 and x>=1799):
print("2")
elif(x<=1800 and x>=1999):
print("1")
|
p02633 | s972881645 | Wrong Answer | import math
X = int(input())
if (360 % X == 0):
print(int(360 / X))
else:
print((360 * X) // math.gcd(360, X)) |
p02786 | s921211499 | Accepted | H = int(input())
k = 1
for i in range(1000000):
if H != 1:
H = H//2
k = k + 1
else:
break
print(2**k - 1) |
p02766 | s954361132 | Accepted | import math
N, K = map(int,input().split())
print(math.floor(math.log(N, K)) + 1)
|
p02983 | s345304098 | Wrong Answer | l,r=map(int,input().split())
l_mod=l%2019
r_mod=r%2019
l_div=l//2019
r_div=r//2019
if l_div<r_div:
print(0)
else:
print(l_mod*(l_mod+1))
|
p03071 | s445656512 | Wrong Answer | n,m = map(int,input().split())
print(n*(n-1) if n >= m else m*(m-1)) |
p03705 | s689437982 | Accepted | n,a,b=map(int,input().split())
print(max(((b*(n-1))+a)-((a*(n-1))+b)+1,0)) |
p03665 | s546881131 | Accepted | import math
def comb(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N, P = map(int, input().split())
A = list(map(int, input().split()))
o, e = 0, 0
for i in A:
if i % 2 == 0:
e += 1
else:
o += 1
ans = 0
for i in range(P, o+1, 2):
ans += comb(o, i)
print(ans * 2 ** e)
|
p03838 | s691385305 | Accepted | a, b = map(int, input().split())
def cal(a,b):
if a < b:
dist1 = b - a
dist2 = abs(b + a) + 1
return min(dist1, dist2)
elif a > b:
if a >= 0 and b <= 0:
return abs(a+b) + 1
else:
return a - b + 2
print(cal(a,b))
|
p02759 | s047880518 | Wrong Answer | N = int(input())
res = 0
if N % 2 == 0:
res = N / 2
else:
res = N // 2 + 1
print(res) |
p03067 | s568124225 | Accepted | A, B, C = map(int, input().split())
if A < C < B:
print("Yes")
elif B < C < A:
print("Yes")
else:
print("No") |
p02832 | s972093530 | Wrong Answer | N = int(input())
a_list = list(map(int, input().split()))
cnt = 0
ref_num = 1
if 1 not in a_list:
print(-1)
exit()
while True:
for i in range(len(a_list)):
if ref_num == a_list[i]:
red = len(a_list[:i])
a_list = a_list[i+1:]
cnt += red
break
ref_num += 1
if a_list == []:
print(cnt)
break
|
p03607 | s125718947 | Wrong Answer | N = int(input())
s = [int(input()) for i in range(N)]
import collections
c = collections.Counter(s)
print(list(c.values()))
ans_lis = [x for x in list(c.values()) if x %2 != 0]
print(len(ans_lis)) |
p03163 | s308258347 | Wrong Answer | n, sum_w = map(lambda x: int(x), input().split())
# goods = list[]
all_weights = []
all_values = []
for _ in range(n):
w, v = map(lambda x: int(x), input().split())
all_weights.append(w)
all_values.append(v)
def max_value(i_item, remaining_weight):
if i_item == n - 1:
return 0 if all_values[i_item] < remaining_weight else all_values[i_item]
return max(all_weights[i_item] + max_value(i_item+1, remaining_weight - all_weights[i_item]),
max_value(i_item+1, remaining_weight))
print(max_value(0, sum_w)) |
p03035 | s408479628 | Wrong Answer | a, y = map(int,input().split())
if a >= 13:
print(y)
elif a <= 12 and a >= 6:
print(y / 2)
else:
print(0) |
p02970 | s607679393 | Accepted | import math
N, D = map(int, input().split())
print(math.ceil(N/(D*2+1))) |
p02993 | s236672995 | Wrong Answer | a, b, c, d=map(int,(input()))
l = [a, b, c, d]
if l.count(a)==l.count(b)==l.count(c)==l.count(d)==1:
print("Good")
else:
print("Bad") |
p02701 | s786174866 | Wrong Answer | from collections import Counter
N = int(input())
S = {}
for i in range(N):
S[i] = input()
print(len(Counter(S.keys()).keys())) |
p02681 | s926681879 | Wrong Answer | s=input()
t=input()
if s==t[0:-1]:
print('yes')
else:
print('no') |
p03997 | s542690772 | Wrong Answer | a = int(input())
b = int(input())
h = int(input())
print((a+b)*h/2) |
p03544 | s289755640 | Wrong Answer | if __name__ == '__main__':
n = int(input())
list =[0]*86
list[0]=2
list[1]=1
for i in range(2,86):
list[i]=list[i-1]+list[i-2]
if n ==86:
print("939587134549734843")
else:
print(list[n-1]) |
p03150 | s747853794 | Accepted | s = list(input())
n = len(s)
for i in range(n):
for j in range(i,n):
t = s[:i] + s[j:]
if ''.join(t) == 'keyence':
print('YES')
exit(0)
print('NO') |
p02917 | s292015501 | Accepted | N = int(input())
B = [int(x) for x in input().split()]
A = [0 for y in range(N)]
A[0] = B[0]
A[N-1] = B[N-2]
for i in range(1,N-1):
A[i] = min(B[i-1],B[i])
print(sum(A))
|
p02996 | s378546614 | Accepted | N = int(input())
AB = list()
for _ in range(N):
ab = list(map(int, input().split()))
ab.reverse()
AB.append(ab)
AB.sort()
#print(AB)
at = 0
flag = False
for i in range(N):
bt = AB[i][0]
at += AB[i][1]
#print(at, bt)
if at > bt:
flag = True
break
if flag:
print("No")
else:
print("Yes")
|
p03137 | s956060793 | Wrong Answer | n, m = map(int,input().split())
x = sorted(list( map(int,input().split())))
if n >= m:
print(0)
else:
d = [0]*(m-1)
for i in range(m-1):
d[i] = x[i+1] - x[i]
d.sort(reverse=True)
if m%2 == 0:
e = m-n-1
else:
e = m-n-2
print(sum(d) - sum(d[0:e])) |
p04019 | s020468859 | Accepted | S = input()
n, w = S.count('N'), S.count('W')
s, e = S.count('S'), S.count('E')
flag = True
if n == 0 or s == 0:
if n != s:
flag = False
if w == 0 or e == 0:
if w != e:
flag = False
print('Yes' if flag else 'No')
|
p03827 | s608322853 | Accepted | n = int(input())
s = input()
x = 0
m = 0
for i in range(n):
if s[i] == "I":
x += 1
elif s[i] == "D":
x -= 1
m = max(m, x)
print(m)
|
p02657 | s959393250 | Accepted | def product(a,b):
return a*b
a,b=map(int,input().split())
print(product(a,b)) |
p03617 | s528145543 | Accepted | q , h , s , d = map(int,input().split())
n = int(input())
qb = q*8
hb = h*4
sb = s*2
db = d
if min(qb,hb,db,sb) != db:
print(n*min(q*4,h*2,s))
elif min(qb,hb,db,sb) == db:
if n % 2 == 0:
print((n//2)*d)
elif n % 2 == 1:
ans = (n//2) * d
ans += min(q*4,h*2,s)
print(ans) |
p02659 | s151259080 | Wrong Answer | import math
in_ = list(input().split())
A = int(in_[0])
B = int(float(in_[1]) * 100)
ans = A * B
ans = int(ans / 100)
print(ans) |
p02645 | s253800373 | Wrong Answer | inp = input('enter :')
if len(inp) <= 3:
print(inp)
else:
inp = inp[0:3]
print(inp) |
p03062 | s470375801 | Accepted | def solve():
N = int(input())
A = list(map(int, input().split()))
B = [abs(a) for a in A]
ans = sum(B)
under = [a for a in A if a<0]
if len(under)%2==1:
ans -= min(B)*2
return ans
print(solve()) |
p02933 | s225280760 | Accepted | a=int(input().strip('\n'))
s=input().strip('\n')
print('red' if a<3200 else s) |
p02719 | s342442478 | Accepted | N, K = map(int, input().split())
N %= K
#print(N, abs(K-N))
print(min(N, abs(K-N)))
|
p03012 | s525399499 | Wrong Answer | n = int(input())
w = [int(_) for _ in input().split()]
d = sum(w)
for i in w:
dd = d - i*2
if abs(d) > abs(dd):
d = dd
print(abs(d))
|
p02842 | s799492915 | Accepted | n = int(input())
x = int(n / 1.08)
while int(x*1.08) <= n:
if int(x*1.08) == n:
print(x)
break
else:
x += 1
if int(x*1.08) > n:
print(":(") |
p03210 | s283972578 | Accepted | age = int(input())
if age == 7 or age == 5 or age == 3:
print('YES')
else:
print('NO')
|
p03206 | s817901584 | Accepted | import sys
input = sys.stdin.readline
def main():
D = int(input())
if D == 25:
ans = "Christmas"
elif D == 24:
ans = "Christmas Eve"
elif D == 23:
ans = "Christmas Eve Eve"
else:
ans = "Christmas Eve Eve Eve"
print(ans)
if __name__ == "__main__":
main()
|
p03474 | s327157853 | Wrong Answer | a,b=map(int,input().split())
s=input()
print("Yes"if len(s)==a+b+1 and s[a]=="-" else "No") |
p02860 | s341214589 | Wrong Answer | N = int(input())
S = input()
if N%2 == 1:
print("NO")
else:
if(S[: N//2] == S[N//2: ]):
print("YES")
else:
print("NO") |
p02647 | s822071581 | Wrong Answer | n, k = map(int, input().split())
a = [int(x) for x in input().split()]
n = 2 * 10**5
k = 2 * 10**5
a = [0] * n
for i in range(min(k, 450)):
tmp = [0] * (n + 1)
for j in range(n):
tmp[max(0, j - a[j])] += 1
tmp[min(n, j + a[j] + 1)] -= 1
cnt = 0
for j in range(n):
cnt += tmp[j]
a[j] = cnt
for i in range(n):
print(a[i], end='') |
p02677 | s211603603 | Accepted | import math
A, B, H, M = [int(x) for x in input().split()]
h = 360 * (H + M/60) / 12
m = 360 * M / 60
cos = math.cos(math.radians(abs(h-m)))
ans = math.sqrt(A*A + B*B - 2*A*B*cos)
print(ans)
|
p03324 | s153351902 | Accepted | d,n = map(int, input().split())
if d == 0:
if n != 100:
print(n)
else:
print(101)
elif d == 1:
if n != 100:
print(n*100)
else:
print(10100)
elif d == 2:
if n != 100:
print(n*10000)
else:
print(1010000) |
p02554 | s357180021 | Accepted | N = int(input())
MOD = 10**9 + 7
_or = 9**N % MOD
_and = 8**N % MOD
wa = ((9**N) * 2 - 8**N) % MOD
ans = (10**N - wa) % MOD
print(ans)
|
p02899 | s416279597 | Accepted | n=int(input())
a=list(map(int,input().split()))
l=[0]*n
for i in range(n):
l[a[i]-1]=i+1
print(*l) |
p03206 | s422311268 | Accepted | D = int(input())
if D == 25:
print("Christmas")
elif D == 24:
print("Christmas Eve")
elif D == 23:
print("Christmas Eve Eve")
elif D == 22:
print("Christmas Eve Eve Eve") |
p02973 | s970261337 | Accepted | N = int(input())
A = [-1*int(input()) for _ in range(N)]
def LIS(seq, wider_sense=False):
from bisect import bisect_left, bisect_right
f = bisect_right if wider_sense else bisect_left
N = len(seq)
INF = 10**18
dp = [INF] * (N+1)
for x in seq:
i = f(dp, x)
dp[i] = x
return f(dp, INF-1)
answer = LIS(A, wider_sense=True)
print(answer)
|
p03723 | s555016363 | Wrong Answer | a,b,c=list(map(int,input().split()))
n=0
H=[]
while True:
S=[a,b,c]
if S in H:
print("-1")
exit()
H.append(S)
if a%2!=0 and b%2!=0 and c%2!=0:
print(n)
exit()
else:
A=a/4
B=b/4
C=c/4
a=a/2+B+C
b=b/2+A+C
c=c/2+A+B
n+=1 |
p03435 | s324865586 | Wrong Answer | y1_list = list(map(int,input().split()))
y2_list = list(map(int,input().split()))
y3_list = list(map(int,input().split()))
a1 = list()
a2 = list()
for i in range(3):
a1.append(y1_list[i] - y2_list[i])
a2.append(y2_list[i] - y3_list[i])
if a1[0] == a1[1] and a1[2] == a1[0]:
if a2[0] == a1[1] and a2[2] == a1[0]:
print("Yes")
else:
print("No")
else:
print("No") |
p02773 | s291891607 | Accepted | N = int(input())
S = [0]*N
for i in range(N):
S[i] = input()
A = {}
for s in S:
if s not in A:
A[s] = 1
else:
A[s] += 1
B = [(a, A[a]) for a in A]
# print(B)
B.sort(reverse=True, key=lambda x: x[1])
# print(B)
count = B[0][1]
ans = []
for b in B:
if b[1] == count:
ans.append(b[0])
ans.sort()
for a in ans:
print(a)
|
p02801 | s589472995 | Accepted | C = input()
chars = "abcdefghijklmnopqrstuvwxyz"
ls = list(chars) + list(chars)
dic = {ls[i]:ls[i+1] for i in range(26)}
print(dic[C]) |
p02600 | s421555100 | Accepted | import math
x=int(input())
print(int(10-math.floor(x/200))) |
p03659 | s657210479 | Accepted | from itertools import*
_, *d = map(int, open(0).read().split())
*a, s = list(accumulate(d))
print(min(abs(s - x*2) for x in a)) |
p02628 | s074775118 | Accepted | a,b = map(int,input().split())
c = input().split()
c = [int(s) for s in c]
c.sort()
x = 0
for i in range(b):
x = x + c[i]
print(x) |
p02909 | s824554090 | Wrong Answer | print({"Sunny":"Clowdy","Cloudy":"Rainy","Rainy":"Sunny"}[input()]) |
p03250 | s108310648 | Accepted | abc = sorted(list(map(int,input().split())))
add = str(abc[2]) + str(abc[1])
print(int(add) + abc[0]) |
p02663 | s594514287 | Wrong Answer | h1, m1, h2, m2, k = map(int, input().split())
print(min(0, (h2*60+m2) - (h1*60+m1) - k)) |
p03730 | s206076282 | Wrong Answer | A, B, C = map(int, input().split())
# n*B+C = kAγ¨γͺγnγ¨kγεε¨γγγ
# k = (n*B+C)/A (n,kγ―ζ΄ζ°)
# γγγζΊγγnγι ηͺγ«θͺΏγΉγγAεηΉ°γθΏγγ°εΏ
γ1ε¨γγγγ―ηγ
n = 0
cnts = [0]*A
while True:
mod = (n*B+C)%A
if cnts[mod] == 1:
print('No')
break
if mod == 0:
print('Yes')
break
n += 1
cnts[mod] = 1
|
p02742 | s331008498 | Accepted | h,w=map(int,input().split())
if h==1 or w==1:
print(1)
else:
print((h*w+1)//2) |
p03797 | s216549819 | Accepted | N, M = map(int ,input().split())
# N + x : M - 2x = 1 : 2
# M - 2x = 2N + 2x
# x = (M - 2N) / 4
if N * 2 >= M:
print(int(M / 2))
else:
x = (M - 2 * N) / 4
N += int(x)
M -= 2 * int(x)
print(N)
|
p03698 | s617562371 | Accepted | import sys
k = 'abcdefghijklmnopqrstuvwxyz'
alp = {}
for i in k:
alp[i] = 0
s = input()
for i in s:
if alp[i] == 0:
alp[i] = 1
else:
print('no')
sys.exit()
print('yes')
|
p02786 | s012523934 | Wrong Answer | H = int(input())
if H == 1:
ret = 1
else:
count = 0
while True:
if H % 2 == 1:
H = int(H / 2)
else:
H = int(H / 2) - 1
count += 1
if H <= 2:
break
ret = 2 **( count + 1) - 1
print(ret)
|
p02835 | s567363266 | Wrong Answer | s=input()
score=0
for i in range(0,int(len(s)/2)):
if s[i]!=s[len(s)-1-i]:
score+=1
print(score)
|
p03814 | s135303435 | Accepted | s = input()
print(len(s[s.index('A'):s.rindex('Z')+1])) |
p03821 | s807914567 | Accepted | N = int(input())
# εΎγγγζΌγγ¦γγ
A = [0]*N
B = [0]*N
for i in range(N):
A[i], B[i] = map(int,input().split())
cnt = 0
for i in range(N-1,-1,-1):
cnt += (B[i]-(A[i]+cnt)%B[i])%B[i]
print(cnt) |
p02719 | s461354010 | Wrong Answer | N, K = map(int, input().split())
if K == 0:
print(N)
else:
if N >= K:
print(N % K)
else:
keisan = abs(N - K)
if keisan > N:
print(N)
else:
print(keisan) |
p03012 | s554373121 | Accepted | N = int(input())
W = list(map(int,input().split()))
diff_min = float('inf')
for T in range(N):
s1 = 0
s2 = 0
for i in range(T+1):
s1 += W[i]
for i in range(N-1,T,-1):
s2 += W[i]
diff = abs(s1-s2)
if diff_min > diff:
diff_min = diff
print(diff_min) |
p02814 | s956038943 | Accepted | import math
import fractions
n, m = map(int, input().split())
a = list(map(int, input().split()))
num = 1
cnt = []
for x in a:
c = 0
for i in range(int(math.log(x,2))):
if x>>c&1:
break
else:
c+=1
cnt.append(c)
if max(cnt) != min(cnt):
print(0)
else:
for x in a:
num = num * (x//2) // fractions.gcd(num, x//2)
print(m//num-(m//num)//2) |
p02691 | s224777309 | Accepted | def resolve():
n = int(input())
a = list(map(int, input().split()))
l = [x - i for i, x in enumerate(a)]
from collections import Counter
c = Counter(l)
ans = 0
for i in range(n):
index = -i * 2 - l[i]
ans += c[index] if index in c else 0
c[l[i]] -= 1
print(ans)
if __name__ == '__main__':
resolve()
|
p02831 | s529865177 | Accepted | A, B = map(int, input().split())
import fractions
gcd = fractions.gcd(A, B)
print(A * B // gcd) |
p02909 | s191221690 | Accepted | s = input()
w = {
'Sunny': 'Cloudy'
, 'Cloudy': 'Rainy'
, 'Rainy': 'Sunny'
}
print(w[s]) |
p02952 | s134232713 | Accepted | N = int(input())
cnt = 0
for i in range(1,N+1):
if len(str(i))%2 != 0:
cnt +=1
print(cnt)
|
p03438 | s272213122 | Accepted | n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt = 0
for i in range(n):
if a[i] <= b[i]:
cnt += (b[i]-a[i])//2
continue
else:
cnt -= a[i]-b[i]
if cnt >= 0: print("Yes")
else: print("No") |
p02793 | s918453701 | Wrong Answer | import fractions as math
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
t=1
for i in numbers:
t=lcm_base(t,i)
return t
N=int(input())
A=list(map(int,input().split()))
A=set(A)
tmp=lcm_list(A)
ans=0
for i in A:
ans+=tmp//i
ans%=(10**9+7)
print(int(ans)) |
p03943 | s172090778 | Wrong Answer | data = list(map(int, input().split()))
if sum(data) % 2 == 0:
print("Yes")
else:
print("No")
|
p02608 | s634170891 | Accepted | n = int(input())
ans_list = [0 for i in range(10**6 + 1)]
for x in range(1,101):
for y in range(1,101):
for z in range(1,101):
a = x**2 + y **2 + z**2 + x*y + z*y + x*z
ans_list[a] += 1
for i in range(1,n+1):
print(ans_list[i]) |
p02973 | s762633515 | Wrong Answer | import bisect
N=int(input())
A=[]
ans=0
for i in range(N):
a=int(input())
A.append(a)
cl=[A[-1]]
ans=1
for i in range(N-1)[::-1]:
a=A[i]
if a>=cl[-1]:
cl.append(a)
ans+=1
else:
b=bisect.bisect_left(cl,a)
cl[b]=a
print(ans) |
p02663 | s208747554 | Accepted | Ha,Ma,Hb,Mb,K = list(map(int,input().split()))
tmp = (Hb*60 + Mb) - (Ha*60 + Ma)
print(tmp-K) |
p03495 | s163070423 | Accepted | from collections import Counter
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
c = Counter(a).most_common()[::-1]
res = 0
for i in range(len(c)-k):
res += c[i][1]
print(res)
|
p02753 | s224443196 | Wrong Answer | S = input()
if S[0] == 'A' and S[1] == 'A' and S[2] == 'A':
print('NO')
elif S[0] == 'B' and S[1] == 'B' and S[2] == 'B':
print('NO')
else:
print('YES') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.