problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02814 | s885010221 | Accepted | from fractions import gcd
n, m = map(int, input().split())
a = [int(i) // 2 for i in input().split()]
x = 1
for i in range(n):
x *= a[i] // gcd(x, a[i])
for i in a:
if x // i % 2 == 0:
print(0)
exit()
print((m // x + 1) // 2) |
p03962 | s996296259 | Accepted | print(len(set(map(int, input().split()))))
|
p03059 | s737861870 | Accepted | a,b,t=map(int,input().split())
print(t//a*b) |
p02705 | s411524616 | Accepted | import math
n = int(input())
print(2*n*math.pi)
|
p03545 | s436088177 | Accepted | s = str(input())
n = len(s) - 1
for i in range(1 << n):
f = ""
f += s[0]
for j in range(n):
if 1 & (i >> j):
f += "+"
f += s[j + 1]
else :
f += "-"
f += s[j + 1]
if eval(f) == 7:
print(f + "=7")
break
|
p03219 | s730327307 | Wrong Answer | x,y=map(int,input().split())
print(x+(y/2)) |
p03796 | s956452980 | Accepted | n = int(input())
MOD = 1000000000 + 7
ans = 1
for i in range(n):
ans *= i + 1
ans %= MOD
print(ans)
|
p02924 | s624978125 | Wrong Answer | N = int(input())
a = N*(N-1)/2
a = int(a)
print(a) |
p03821 | s018807674 | Wrong Answer | n = int(input())
l = [list(map(int, input().split())) for i in range(n)]
c = 0
for i in range(1, n+1):
a, b = l[-i]
a += c
if a >= b:
if a%b > 0:
c += b - (a%b)
else:
c += b-a
print(c) |
p02629 | s137614010 | Accepted | N = int(input())
def dog(n, b):
arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y","z"]
if (int(n/b)):
return dog(int(n/b)-1, b) + str(arr[n%b])
return str(arr[n%b])
print(dog(N-1,26)) |
p02613 | s832923496 | Accepted | n = int(input())
dic = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for i in range(n):
s = input()
dic[s] += 1
for k, v in dic.items():
print("%s x %s" % (k, v)) |
p03494 | s690644746 | Accepted | N = int(input())
nums = list(map(int,input().split()))
flag = True
count = 0
while(flag):
for num in nums:
if(num % 2 == 1):
flag = False
if(flag):
nums = list(map(lambda x:x//2,nums))
count += 1
print(count) |
p03324 | s682889842 | Accepted | d, n = map(int, input().split())
if n < 100:
print(n * 100**d)
else:
print(101 * 100**d) |
p03385 | s759110631 | Accepted | s=input()
print("Yes" if len(set(s))==3 else "No") |
p02772 | s700451545 | Accepted | n = int(input())
a = list(map(int, input().split()))
flag = True
for i in range(len(a)):
if a[i] % 2 == 0:
if a[i] % 3 == 0 or a[i] % 5 == 0:
pass
else:
flag = False
if flag:
print('APPROVED')
else:
print('DENIED')
|
p02795 | s827091863 | Accepted | H = int(input())
W = int(input())
N = int(input())
M = max(H, W)
print((N+M-1)//M) |
p03282 | s485919114 | Wrong Answer | S=input()
k=int(input())
if S[0]=='1' and k==1:
print(1)
else:
for s in S:
if s!='1':
print(s)
exit()
|
p02552 | s040142295 | Accepted | x = int(input())
if x == 1:
print(0)
else:
print(1) |
p03481 | s104835314 | Accepted | X, Y = map(int, input().split())
for i in range(1, 101):
if X > Y:
ans = i - 1
break
X *= 2
print(ans)
|
p02761 | s503541415 | Wrong Answer | n,m=map(int,input().split())
list=[list(map(int,input().split())) for _ in range(m)]
flag=False
ans=['10']*n
for i in range(m):
if (list[i][0]==n and list[i][1]!=0) or (n==1 and list[i][0]==n and list[i][1]==0):
flag=True
ans[list[i][0]-1]=str(min(int(ans[list[i][0]-1]),list[i][1]))
if flag==True:
for j in ra... |
p02688 | s639658212 | Accepted | N, K = map(int, input().split())
d = []
A = []
for i in range(K):
d.append(int(input()))
A.append(input().split())
child = list(range(1, N+1))
non_child = list(range(1, N+1))
for i in child:
for j in range(K):
for k in range(d[j]):
if i == int(A[j][k]):
non_child.re... |
p03126 | s142912875 | Accepted | n,m=map(int,input().split())
ans={i for i in range(1,m+1)}
for i in range(n):
a=[int(i) for i in input().split()]
a=a[1:]
ans=ans&set(a)
print(len(list(ans))) |
p02802 | s456106504 | Accepted | n,m = map(int, input().split())
accurate = [0] * n
correct = 0
wrong = [0] * n
penalty = 0
for i in range(m):
p,s = input().split()
num = int(p) - 1
if s == 'AC' and accurate[num] == 0:
accurate[num] += 1
correct += 1
penalty += wrong[num]
elif s == 'WA':
wrong[num] +=... |
p03815 | s270349257 | Wrong Answer | from math import *
x = int(input())
m = 11
if x < 6:
ans = 1
elif x < 11:
ans = 2
elif x%m == 0:
ans = x*2//m
elif 0 < x%m <= 5:
ans = x*2//m+1
elif 6 <= x%m:
ans = x*2//m+1
print(ans) |
p03448 | s874001952 | Wrong Answer | a = int(input())
b = int(input())
c = int(input())
x = int(input())
count=0
for s in range(a+1):
if s*500 == x:
count += 1
for t in range(b+1):
if s*500 + t*100 == x:
count += 1
for u in range(c+1):
if s*500 + t*100 + u*50 == x:
count += 1
... |
p03241 | s368393992 | Accepted | def make_divisors(n):
div = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
div.append(i)
if i != n // i:
div.append(n//i)
return div
n, m = map(int, input().split())
d = make_divisors(m)
d.sort()
for i in reversed(d):
if i * n <= m:
print(i)
... |
p02730 | s122107026 | Accepted | import copy
S = list(input())
N = len(S)
ReS = copy.copy(S)
o = 1
for i in S:
ReS[N-o] = i
o += 1
if S == reversed(S):
print("Yes")
if S == ReS:
if S[0:int((N-1)/2)] == ReS[int((N+1)/2): N]:
if S[int((N+1)/2): N] == ReS[0:int((N-1)/2)]:
print("Yes")
else:
print("N... |
p03761 | s737465431 | Accepted | import numpy as np
n = int(input())
argList = [input() for _ in range(n)]
keys = list('abcdefghijklmnopqrstuvwxyz')
nMat = []
for s in argList:
nList = [0]*26
for i, k in enumerate(keys):
nList[i] = s.count(k)
nMat.append(nList)
nMat = np.array(nMat)
minLst = nMat.min(axis=0)
ret = ''
for i,num in e... |
p03493 | s896540233 | Accepted | #第2問 ABC081A
number = list(map(int,input()))
a = 0
for i in number:
if i == 1:
a = a+1
print(a) |
p02657 | s931266469 | Accepted | a,b = map(int,input().split())
print(a*b) |
p02862 | s427410768 | Accepted | x,y = map(int,input().split())
n = 0
mod = 10**9+7
ans = 0
if not (x+y)%3:
n = (x+y)//3
x-=n
y-=n
if not x<0 or y<0:
ans = 1
for i in range(x):
ans = ans*(n-i)*pow(i+1,mod-2,mod)%mod
print(ans) |
p02796 | s054354732 | Accepted | n = int(input())
s = []
t = []
for i in range(n):
xa,la = map(int,input().split())
s.append(xa-la)
t.append(xa+la)
#print(s)
#print(t)
itv = []
for i in range(n):
itv.append([t[i],s[i]])
itv.sort()
#print(itv)
ass = 0
tt = -1000000000
for i in range(n):
if tt <= itv[i][1]:
ass += 1
... |
p02732 | s885610348 | Accepted | def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
n=n0()
a=n1()
def comb(n):
if n<=1:
return 0
if n==2:
return 1
return (n*(n-1))//2
from c... |
p03061 | s022968877 | Accepted | n=int(input())
a=list(map(int,input().split()))
import fractions as math
l=[0]
r=[0]
for i in range(n-1):
li=math.gcd(l[i],a[i])
l.append(li)
ri=math.gcd(r[i],a[n-i-1])
r.append(ri)
m=[]
for i in range(n):
mi=math.gcd(l[i],r[n-i-1])
m.append(mi)
print(max(m)) |
p02631 | s582540978 | Accepted | import sys
sys.setrecursionlimit(500005)
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
n = ni()
a = na()
x = 0
for v in a:
x ^= v
b = []
for i in range(n):
b.append(a[i]^x)
print(" ".join(map(st... |
p03387 | s713911465 | Accepted | a, b, c = map(int, input().split())
M = max(a, b, c)
if (a+b+c)%2 != (M* 3) % 2:
M += 1
diff = 3 * M - a - b - c
print(diff // 2) |
p03352 | s724822982 | Wrong Answer | X = int(input())
if X < 4:
print(1)
exit()
ans = 1
for x in range(2,X-1):
for p in range(2,X-1):
if(x**p > X): break
ans = x**p
print(ans) |
p02819 | s865084700 | Accepted | x=int(input())
while True:
r = int(x ** .5)
for i in range(2,r+1):
if x%i == 0:
break
else:
break
x+=1
print(x)
|
p02583 | s166907811 | Accepted | n = int(input())
l = list(map(int,input().split(' ')))
l = sorted(l)
ans = 0
for i in range (0,n-2):
for j in range (i + 1,n-1):
for k in range (j + 1,n):
if l[i] != l[j] and l[j] != l[k] and l[i] != l[k] and l[i] + l[j] > l[k]:
ans += 1
print(ans) |
p02684 | s047550743 | Accepted | from collections import deque
n, k = list(map(int, input().split()))
a = [0, ] + list(map(int, input().split()))
stack = deque([1, ])
visited = [0] * (n + 1)
hist = []
open = []
loop = []
while stack:
now = stack.popleft()
if visited[now] == 1:
b = hist.index(now)
open = hist[:b]
loop = ... |
p02633 | s084560691 | Accepted | x = int(input())
n=1
while 1:
angle_n = 360*n
if angle_n % x == 0:
ans = angle_n // x
break
else:
n += 1
print(ans) |
p03352 | s412000371 | Accepted | x = int(input())
ans = 1
for i in range(2,x+1):
j = 2
while i **j <= x:
ans = max(ans, i**j)
j+=1
print(ans) |
p03262 | s221786162 | Wrong Answer | N, X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
from math import gcd
g = x[1] - x[0]
for i in range(N-1):
g = gcd(g, (x[i+1] - x[i]))
print(abs(g)) |
p02705 | s503468557 | Wrong Answer | import math
x = math.pi
a=input()
n = int(a)
print(n*x)
|
p03086 | s660956830 | Accepted | # AtCoder Beginner Contest 122 B - ATCoder
import sys
S = str(input())
target = ['A', 'C', 'G', 'T']
ans = 0
temp_ans = 0
for s in S:
if s in target:
temp_ans += 1
else:
temp_ans = 0
ans = max(ans, temp_ans)
print(ans)
|
p02664 | s231114670 | Accepted | def main():
T = input()
T = T.replace('?', 'D')
# cnt = 0
# cnt_pd = t.count('PD')
# cnt_d = t.count('D')
# cnt = cnt_d + cnt_pd
print(T)
main() |
p03773 | s030946311 | Accepted | a,b = map(int,input().split())
if a + b >= 24:
print(a+b-24)
else:
print(a+b) |
p03327 | s845666009 | Accepted | print("ABC" if int(input()) <= 999 else "ABD") |
p03633 | s301600036 | Accepted | import fractions
from functools import reduce
def lcm_base(x, y):
return (x * y) // fractions.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
N=int(input())
T=[]
for i in range(N):
Ti=int(input())
T.append(Ti)
print(lcm_li... |
p03162 | s723104355 | Accepted | n = int(input())
action = []
for i in range(n):
action.append([int(i) for i in input().split()])
dp = [[0 for _ in range(3)] for _ in range(n+1)]
for i in range(n):
for j in range(3):
for k in range(3):
if j == k:
continue
dp[i+1][k] = max(dp[i+1][k], dp[i][j] + ... |
p03013 | s547731851 | Accepted | N,M = map(int, input().split())
a = [int(input()) for i in range(M)]
#初期化
dp=[-1]*N
dp[0]=1
for i in a:
dp[i-1] = 0
for i in range(1,N):
if dp[i]==0:
continue
elif i==1:
dp[i]=dp[i-1] + 1
else:
dp[i]=dp[i-1]+dp[i-2]
print(dp[N-1]%1000000007) |
p03698 | s031573825 | Accepted | S = list(input())
if len(S) == len(set(S)):
print("yes")
else:
print("no") |
p03994 | s543368799 | Wrong Answer | s = input()
k = int(input())
slen = len(s)
new_s = ""
for i in range(slen):
val = ord("z") + 1 - ord(s[i])
if k >= val:
k -= val
new_s += "a"
else:
new_s += s[i]
if k > 0:
tmp_val = ord(new_s[slen-1]) + k % 26
if tmp_val > ord("z"):
tmp_val -= 26
new_s = new_s[:-1] + chr(tmp_val)
prin... |
p03545 | s632451349 | Accepted | N=input()
for i in range(2**(len(N)-1)):
OP=["-","-","-"]
for j in range(len(N)-1):
if ((i>>j)&1):
OP[3-j-1]="+"
formula=""
for n,op in zip(N,OP+[""]):
formula+=n+op
if eval(formula)==7:
print(formula+"=7")
break |
p03493 | s602327177 | Accepted | s = input()
print(s.count('1')) |
p02792 | s714007247 | Accepted | #設定
import sys
input = sys.stdin.buffer.readline
#ライブラリインポート
from collections import defaultdict
#入力受け取り
def getlist():
return list(map(int, input().split()))
#処理内容
def main():
N = int(input())
L = [[0] * 10 for i in range(10)]
for i in range(1, N + 1):
A = str(i)
x = int(A[0])
y = int(A[-1])
L[x][y] += ... |
p03705 | s588632060 | Wrong Answer | n, a, b = map(int, input().split())
if a > b:
print(0)
if n == 1 and a != b:
print(0)
else:
min_num = a * (n - 2)
max_num = b * (n - 2)
print(max_num - min_num + 1) |
p02951 | s294003428 | Accepted | a,b,c = map(int,input().split())
d = a - b
if c - d <= 0:
print(0)
else:
print(c - d) |
p03126 | s541177209 | Accepted | n,m=map(int,input().split())
cnt=[n for _ in range(m)]
for i in range(n):
k = list(map(int,input().split()))
for i in range(1, k[0]+1):
cnt[k[i]-1] -= 1
ans = 0
for i in range(m):
if cnt[i] == 0:
ans += 1
print(ans) |
p03327 | s202637530 | Accepted | n = int(input())
if n>=1000:
print('ABD')
else:
print('ABC') |
p03293 | s809927890 | Accepted | s,t=[input() for i in range(2)]
for _ in range(len(s)):
s=s[-1]+s[:-1]
if s==t:
print("Yes")
break
else:
print("No") |
p03705 | s693142330 | Accepted | n,a,b = map(int, input().split())
if a>b:
print(0)
exit()
if n==1:
if b-a>0:
print(0)
else:
print(1)
exit()
if n==2:
print(1)
exit()
res = (a+b*(n-1)) - (a*(n-1)+b) + 1
print(res) |
p02547 | s733819415 | Accepted | n = int(input())
t = 0
f = False
for i in range(n):
a,b = map(int, input().split())
if a == b:
t += 1
else:
t = 0
if t>= 3:
f = True
# break
if f:
print("Yes")
else:
print("No")
|
p02987 | s780076927 | Accepted | s = str(input())
if len(set(s)) == 1:
print('No')
elif (s[0] == s[1]) and (s[2] == s[3]):
print('Yes')
elif (s[0] == s[2]) and (s[1] == s[3]):
print('Yes')
elif (s[0] == s[3]) and (s[1] == s[2]):
print('Yes')
else:
print('No') |
p02973 | s693253730 | Accepted | n = int(input())
A = [int(input()) for _ in range(n)]
B = []
import bisect
for i, a in enumerate(A):
if len(B) == 0:
B.append(-a)
else:
j = bisect.bisect_right(B, -a)
#print(j)
if j == len(B):
B.append(-a)
elif j == 0:
B[0] = -a
else:
... |
p02748 | s681213629 | Accepted | A, B, M = map(int, input().split())
list_A = list(map(int, input().split()))
list_B = list(map(int, input().split()))
ans = min(list_A) + min(list_B)
for i in range(M):
tmp_list = list(map(int, input().split()))
tmp_cost = list_A[tmp_list[0]-1] + list_B[tmp_list[1]-1] - tmp_list[2]
ans = min(tmp_cost, ans... |
p02691 | s578926799 | Accepted | n = int(input())
a = list(map(int,input().split()))
l,r = {},{}
for i in range(n):
xl = i+a[i]
if xl in l:
l[xl] += 1
else:
l[xl] = 1
xr = i-a[i]
if xr in r:
r[xr] += 1
else:
r[xr] = 1
ans = 0
for x in l:
if x in r:
ans += l[x] * r[x]
print(ans) |
p02988 | s891073155 | Wrong Answer | n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(len(p)-1):
if (p[i] > p[i-1] and p[i] < p[i+1]) or (p[i] < p[i-1] and p[i] > p[i+1]):
count += 1
print(count) |
p02665 | s141272349 | Accepted | N = int(input())
A_leaf = list(map(int, input().split()))
if N == 0:
print(1 if A_leaf[0] == 1 else -1)
exit()
s = [0]*(N+2)
for i in range(1, N+2):
s[i] = s[i-1] + A_leaf[i-1]
node = [1]*(N+1)
for i in range(1, N+1):
node[i] = min((node[i-1] - A_leaf[i-1])*2, s[N+1]-s[i])
if node[i] < A_leaf[i]:
... |
p02676 | s413750063 | Wrong Answer | n = int(input())
s = input()
if len(s) == n:
print(s)
else:
print(s[:n] + '...') |
p02953 | s793079174 | Wrong Answer | import sys
n=int(input())
h=list(map(int,input().split()))
for i in range(1,n-1):
if h[i-1]<=h[i]<=h[i+1]:
pass
else:
h[i]-=1
if h[i-1]<=h[i]<=h[i+1]:
pass
else:
print("No")
sys.exit()
print("Yes") |
p03817 | s393666826 | Accepted | si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
lmii = lambda: list(map(int, input().split()))
lmsi = lambda: list(map(str, input().split()))
smii = lambda: sorted(map(int, input().split()))
# ----------
x = ii()
d, m = divmod(x, 11)
ans = 2 * d
if m > 0:
ans += 1
... |
p02861 | s590720801 | Accepted | import itertools
n = int(input())
xy = [[int(i) for i in input().split()] for _ in [0]*n]
it = list(itertools.permutations(xy, n))
ans = 0
for i in it:
for j in range(len(list(i))-1):
ans += ((i[j][0] - i[j+1][0])**2 + (i[j][1] - i[j+1][1])**2)**0.5
print(ans/len(it)) |
p02918 | s003991362 | Accepted | N,K = map(int,input().split())
S = list(input())
tmp = []
tmp.append(S[0])
for i in range(1,N):
if(S[i] != S[i-1]):
tmp.append(S[i])
G = len(tmp)
G -= 2*K
G = max(G-1,0)
print(N-G-1) |
p03262 | s929649469 | Accepted | from fractions import gcd
N, X = map(int, input().split())
X = [X] + list(map(int, input().split()))
ans = 0
for i in range(N):
ans = gcd(ans, abs(X[i + 1] - X[i]))
print(ans)
|
p02613 | s090097684 | Accepted | N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
temp = input()
if temp == "AC":
AC = AC + 1
if temp == "WA":
WA = WA + 1
if temp == "TLE":
TLE = TLE + 1
if temp == "RE":
RE = RE + 1
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + st... |
p03544 | s293578564 | Accepted | import sys
input = sys.stdin.readline
def main():
N = int(input())
L = [0] * 87
L[0] = 2
L[1] = 1
for i in range(2, 87):
L[i] = L[i-1] + L[i-2]
print(L[N])
if __name__ == "__main__":
main()
|
p02836 | s681248017 | Accepted | s=input()
print(len([True for i in range(len(s)//2) if s[i]!=s[-1-i]])) |
p03075 | s980392181 | Accepted | from itertools import combinations
import sys
x = [input() for _ in range(5)]
k = int(input())
for i in combinations(x,2):
tmp = abs(int(i[0])-int(i[1]))
if(tmp > k):
print(':(')
sys.exit()
print('Yay!') |
p03644 | s101906686 | Accepted | N=int(input())
i=0
s=2
ans=1
while 1:
ans = s**i
if ans>N:
print(s**(i-1))
exit()
i+=1 |
p03627 | s188149602 | Accepted | from collections import Counter
n = int(input())
dum = [0]*n
a_li = list(map(int,input().split()))
a_counter = Counter(a_li)
a_most = a_counter.most_common()
count = 0
for i,j in a_most:
if j >= 2:
dum[count] = i
count += 1
dum.sort(reverse=1)
if a_counter[dum[0]] >= 4:
print(dum[0]**2)
else:
pr... |
p02712 | s934884526 | Wrong Answer | n = int(input())
total = 0
for i in range(n):
if i % 3 != 0 and i % 5 != 0:
total += i
print(total) |
p03797 | s389824102 | Accepted | import sys
input = sys.stdin.readline
def main():
N, M = [int(x) for x in input().split()]
if M < N * 2:
print(M // 2)
else:
ans = N
M = M - N * 2
ans += M // 4
print(ans)
if __name__ == '__main__':
main()
|
p02664 | s619848619 | Accepted | def main():
T = input()
print(T.replace('?', 'D'))
if __name__ == "__main__":
main() |
p04012 | s221151335 | Wrong Answer | s = input()
cnt = 0
for i in s:
if s.count(i) % 2 == 0:
cnt += 1
else:
print("No")
if cnt == len(s):
print("Yes")
else:
print("No")
|
p02696 | s051295761 | Wrong Answer | import math
line = input()
a, b, n = line.split(" ")
a, b, n = int(a), int(b), int(n)
# ans = 0
# for i in range(n+1):
# ans = math.floor((a*i)/b) - math.floor(i/b)
# print(ans)
ans1 = math.floor((a*n)/b) - math.floor(n/b)
ans2 = math.floor((a*n-1)/b) - math.floor(n-1/b)
print(max(ans1, ans2)) |
p03633 | s584738675 | Wrong Answer | n = int(input())
t = [int(input()) for _ in range(n)]
def gcd(a, b):
if b == 0:
return a
return gcd(b, a%b)
l = t[0]
for i in range(1, n):
g = gcd(l, t[i])
l = t[i-1]*t[i] // g
print(l) |
p03417 | s060649872 | Wrong Answer | def main():
N, M = map(int, input().split())
if N > M:
N, M = M, N
if N == 1:
print(M-2)
elif N == 2:
print(0)
else:
print((N-2) * (M-2))
if __name__ == '__main__':
main()
|
p02582 | s719021549 | Accepted | s=input()
if 'RRR' in s:
print(3)
elif 'RR' in s:
print(2)
elif 'R' in s:
print(1)
else:
print(0) |
p04043 | s573875954 | Wrong Answer |
def main():
input_str = input()
a,b,c = input_str.split(' ')
a = int(a)
b = int(b)
c = int(c)
flag = False
for i in [a,b,c,'fin']:
if i == 'fin':
if a+b+c== 15:
flag = True
elif not i in [5,7]:
break
if flag:
print('YE... |
p02897 | s767310790 | Wrong Answer | N = int(input())
if N == 1:
print(1/float(1))
elif N%2==0:
print((N//2)/float(N))
else:
print((N//2)/float(N))
|
p02621 | s343538859 | Accepted | a = int(input())
print(a + a*a + a*a*a) |
p02642 | s597479922 | Accepted | N = int(input())
A = list(map(int,input().split()))
ans = [0]*(10**6+1)
mul = set()
for i in range(N):
if ans[A[i]] == 0:
ans[A[i]] = 1
p = A[i]*2
while p <= 10**6:
ans[p] = -1
p += A[i]
elif ans[A[i]] == 1:
ans[A[i]] = 2
q = 0
for i in range(10**6+1):
if ans[i] == 1:
q += 1
print(q)
|
p04012 | s750011317 | Wrong Answer | from sys import exit
w = input()
w_set = list(set(w))
for i in range(len(w_set)):
if w.count(w_set[i]) % 2 != 0:
print("No")
exit()
else:
print("Yes")
exit() |
p03962 | s708637328 | Accepted | a,b,c = map(int, input().split())
if a==b==c: ans = 1
elif a != b and b != c and a != c: ans = 3
else: ans = 2
print(ans) |
p03095 | s940111925 | Accepted | from collections import Counter
MOD = 10**9 + 7
n = int(input())
c = Counter(input())
ans = 1
for k,v in c.items():
ans = (ans*(v+1)) % MOD
print(ans-1) |
p02836 | s725598653 | Wrong Answer | s = input()
n_s = s[::-1]
print(sum(s != n_s for i,j in zip(s, n_s))) |
p02802 | s064785579 | Accepted | n,m = map(int, input().split())
AC = [False]*n
WA = [0]*n
for i in range(m):
p,s = input().split()
p = int(p)-1
if AC[p] == False:
if s == 'WA':
WA[p] += 1
else:
AC[p] = True
wa = 0
for i in range(n):
if AC[i]:
wa += WA[i]
print(AC.count(True... |
p02759 | s641586989 | Accepted | N = int(input())
if N % 2 == 0:
print(N//2)
else:
print(N//2+1)
|
p03455 | s246297084 | Wrong Answer | a,b = map(int,input().split())
print("Even" if (a * b) % 2 else "Odd" ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.