problem_id stringclasses 428 values | submission_id stringlengths 10 10 | status stringclasses 2 values | code stringlengths 5 816 |
|---|---|---|---|
p03625 | s732675391 | Accepted | #071_C
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a).most_common()
edges = []
for l, cnt in c:
if cnt < 2:
break
else:
edges.append(l)
if cnt > 3:
edges.append(l)
edges.sort(reverse= True)
if len(edges) < 2:
print(0)
else:
print(edges[0] * edges[1]) |
p02658 | s939353808 | Accepted | from sys import stdin,stdout
LI=lambda:list(map(int,input().split()))
MAP=lambda:map(int,input().split())
IN=lambda:int(input())
S=lambda:input()
import math
from collections import Counter,defaultdict
n=IN()
a=LI()
p=1
if 0 in a:
print(0)
exit()
for i in a:
p*=i
if p>pow(10,18):
print(-1)
exit()
print(p)
|
p03338 | s747586027 | Wrong Answer | n = int(input())
s = input()
cnt = 1
for i in range(1, n):
c = 0
s1 = s[i:]
s2 = s[:i]
S = set(s1)
for j in S:
if j in s2:
c += 1
cnt = max(cnt, c)
print(cnt) |
p02801 | s672786198 | Accepted | def main():
C = input()
print(chr(ord(C) + 1))
if __name__ == "__main__":
main()
|
p03127 | s103145569 | Accepted | import itertools
import fractions
n=int(input())
a=list(map(int,input().split()))
a.sort()
mina=a[0]
ans = 10**18
for i in range(n):
ans = min(ans, fractions.gcd(a[i], mina))
print(ans) |
p03317 | s918604974 | Wrong Answer | import numpy as np
N,K = map(int,input().split())
an = list(map(int,input().split()))
min_an_index = np.argmin(an)
a = min_an_index
b = N - min_an_index - 1
if K > a:
b -= K - a - 1
if b < 0:
b = 1
if K > b:
a -= K - b - 1
if a < 0:
a = 1
a1 = a // (K-1)
if a % (K-1) != 0:
a1 += 1
b1 = b // (K-1)
if b % (K-1) != 0:
b1 += 1
count = a1 + b1
print(count) |
p02663 | s921571350 | Wrong Answer | h1, m1, h2, m2, k = map(int, input().split())
piyo = h2*60 + m2 - (h1*60 + m1)
result = (piyo // k - 1) * k
print(result) |
p03386 | s301627347 | Wrong Answer | A, B, K = map(int, input().split())
x=[]
if (B-A) <= K:
for i in range(A, B+1):
print(i)
else:
for i in range(A, A+K):
x.append(i)
for i in range(B-K, B+1):
x.append(i)
for i in x:
print(i) |
p02783 | s551772958 | Accepted | #a,b = map(int, input().split())
import math
if __name__ == "__main__":
H,A = map(int,input().split())
print(math.ceil(H / A)) |
p03073 | s401134247 | Accepted | s=input()
l=len(s)
p0=[0]*l
p1=[1]*l
for i in range(l):
if i%2==1:
p0[i]=1
p1[i]=0
c0=0
c1=0
for i in range(l):
if int(p0[i])!=int(s[i]):
c0+=1
for i in range(l):
if int(p1[i])!=int(s[i]):
c1+=1
print(min(c0,c1))
|
p02594 | s554761437 | Accepted | t=int(input())
if t>=30:
print("Yes")
else:
print("No")
|
p03617 | s324167182 | Wrong Answer | Q, H, S, D = map(int, input().split())
N = int(input())
if N%2:
if D/2 < min(Q*4, H*2, S):
print(int(N//2*(D/2))+(N-N//2)*min(Q*4, H*2, S))
else:
print(N*min(Q*4, H*2, S))
else:
print(int(N*min(Q*4, H*2, S, D/2))) |
p03264 | s123546505 | Accepted | k = int(input())
if k%2==1:
print((k//2+1)*(k//2))
else:
print(k**2//4) |
p03162 | s238716440 | Wrong Answer | n=int(input())
abc=[[-1,-1,-1]]
memo=[-1 for i in range(n+1)]
for i in range(n):
a,b,c=map(int,input().split())
abc.append([a,b,c])
dp=[0 for i in range(n+1)]
for i in range(1,n+1):
for j in range(3):
if memo[i-1]==j:
continue
elif dp[i]<dp[i-1]+abc[i][j]:
memo[i]=j
dp[i]=dp[i-1]+abc[i][j]
print(dp[-1]) |
p02659 | s468858863 | Accepted | from math import floor
from decimal import Decimal
a, b = input().split()
a = int(a)
b = Decimal(b)
print(floor(a * b)) |
p03030 | s074656839 | Wrong Answer | n = int(input())
sp = []
for i in range(n):
s,p = map(str,input().split())
sp.append([s,int(p),i+1])
sp.sort(key = lambda x:x[1],reverse = True)
sp.sort(key = lambda x:x[0],reverse = True)
for i in sp:
print(i[2]) |
p03657 | s138753968 | Accepted | a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
print("Possible")
else:
print("Impossible") |
p03017 | s150285905 | Wrong Answer | n,a,b,c,d=map(int,input().split())
s=input()
s = list(s)
if c > d:
x=b
y=d
b,d=a,c
a,c=x,y
s[b-1] = "#"
for i in range(b-1,d-1):
if s[i] == s[i+1] == "#":
print("No")
exit()
s[b-1] = "."
s[d-1] = "#"
for i in range(a-1,c-1):
if s[i] == s[i+1] == "#":
print("No")
exit()
print("Yes") |
p02957 | s555496102 | Accepted | a,b=map(int,input().split())
if (a+b)%2==0:
print((a+b)//2)
else:
print("IMPOSSIBLE") |
p03852 | s647054127 | Wrong Answer | c = input()
for c in "aiueo":
print("vowel")
else:
print("consonant")
|
p02677 | s719182364 | Accepted | import numpy as np
import math
A,B,H,M = input().split()
A = int(A)
B = int(B)
H = int(H)
M = int(M)
angle = abs(30* H - 5.5 * M)
if angle > 180:
angle = 360 - angle
ans = np.sqrt((A**2 + B**2) - (2 * A * B * np.cos(np.radians(angle))))
print(ans) |
p03071 | s052228074 | Accepted |
a, b = map(int, input().split())
print(max(a+a-1,b+b-1,a+b)) |
p03109 | s330661953 | Accepted | s = input()
yyyy, mm, dd = [int(n) for n in s.split("/")]
print("Heisei" if mm < 5 else "TBD") |
p02994 | s297972883 | Accepted | N, L = map(int, input().split())
Ts = []
for idx in range(1, N+1):
taste = idx + L - 1
Ts.append(taste)
min_t = 20000000000
total = sum(Ts)
for t in Ts:
if abs(t) < abs(min_t):
min_t = t
print(total-min_t) |
p02607 | s801686447 | Accepted | n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
if i % 2 == 0 and a[i] % 2 != 0:
ans += 1
print(ans)
|
p02553 | s385069301 | Wrong Answer | a, b, c, d = map(int,input().split())
x = 0
y = 0
if a >= 0 and c >= 0:
x = b
y = d
elif a >= 0 and d < 0:
x = a
y = d
elif b < 0 and c >= 0:
x = b
y = c
elif b <= 0 and d <= 0:
x = a
y = c
print(x * y)
|
p02797 | s338409468 | Accepted | N, K, S = map(int, input().split())
S2 = S-1 if S == 1000000000 else S+1
As = [S]*K+[S2]*(N-K)
print(" ".join(map(str, As)))
|
p03469 | s971741473 | Wrong Answer | s1,s2,s3 = input().split('/')
print('2017/01/'+s3)
|
p03486 | s824397755 | Accepted | s = list(input())
t = list(input())
S = sorted(s)
T = sorted(t, reverse = True)
U = min(len(s), len(t))
for i in range(U):
if S[i] < T[i]:
print("Yes")
exit()
elif S[i] == T[i]:
continue
else:
print("No")
exit()
if len(S) < len(T):
print("Yes")
else:
print("No") |
p03043 | s035169343 | Wrong Answer | import math
from fractions import Fraction
N, K = map(int, input().split())
ans = 0
for i in range(1, N + 1):
if i >= K:
ans += Fraction(1, N)
else:
ans += Fraction(1, N) * Fraction(1, 2) ** (int(math.log2(K / i)) + 1)
print(float(ans)) |
p02811 | s107347538 | Wrong Answer | # Code for A - 500 Yen Coins
# Use input() to fetch data from STDIN
print("Hello world") |
p03126 | s466777928 | Accepted | N, M = map(int, input().split())
A = []
for i in range(N):
A_i = list(map(int, input().split()))
A.append(A_i[1:])
sum = [0]*M
for i in range(N):
for j in range(len(A[i])):
sum[A[i][j]-1] += 1
print(sum.count(N))
|
p03407 | s861542310 | Accepted | A,B,C=map(int,input().split(' '))
if A+B >= C:
print('Yes')
else:
print('No') |
p02820 | s727551114 | Accepted | from array import array
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = array("u", list(input()))
for i in range(k, n):
if t[i] == t[i-k]:
t[i] = "*"
ans = (t.count("r") * p +
t.count("s") * r +
t.count("p") * s)
print(ans) |
p03795 | s131292848 | Accepted | n=int(input())
tmp=n//15
print((800*n)-tmp*200) |
p03338 | s342347356 | Wrong Answer | n = int(input())
s = input()
ans = -1*float('inf')
for i in range(0, n-1):
x = set(s[:i+1])
y = set(s[i+1:])
dif = max(x, y) - min(x, y)
ans = max(ans, len(max(x, y) - dif))
print(ans) |
p03331 | s076926285 | Wrong Answer | n=input()
ans=0
for i in range(len(n)):
ans+=int(n[i])
if ans==int(n[0]):
ans+=9
print(ans) |
p03309 | s683226705 | Accepted | n = int(input())
a = list(map(int,input().split()))
ami = [a[i]-(i+1) for i in range(n)]
ami.sort()
# print(ami)
ans = 0
for i in range(n):
ans += abs(ami[i] - ami[n // 2])
print(ans)
|
p02691 | s883043095 | Wrong Answer | import collections
N = int(input())
A = list((map(int,input().split())))
index = list(range(1,N+1))
R = [index[i] - A[i] for i in range(N)]
L = [index[j] + A[j] for j in range(N)]
R_dict = collections.Counter(R)
L_dict = collections.Counter(L)
ans=0
for i in R_dict.keys()&L_dict.keys():
ans+=max(R_dict[i], L_dict[i])
print(ans) |
p03761 | s990986982 | Wrong Answer | from collections import Counter
n = int(input())
S = [input() for _ in range(n)]
ans = Counter(S[0])
for i in range(1,n):
tmp = Counter(S[i])
for a in ans.keys():
if a in tmp:
ans[a] = min(ans[a],tmp[a])
else:
ans[a] = 0
x = ''
for a in ans.items():
x += a[0]*a[1]
print(x) |
p02796 | s076947352 | Accepted | N = int(input())
xl = [list(map(int, input().split())) for _ in range(N)]
rl = []
for i in range(N):
rl.append((xl[i][0] - xl[i][1], xl[i][0] + xl[i][1]))
rl.sort(key=lambda x: x[1])
cnt = 0
tmp = -10 ** 18
for i, j in rl:
if tmp <= i:
cnt += 1
tmp = j
print(cnt) |
p02553 | s195271927 | Accepted | list1 = input()
list2 = list1.split()
a = int(list2[0])
b = int(list2[1])
c = int(list2[2])
d = int(list2[3])
#x = [i for i in range(a,b+1)]
#y = [j for j in range(c,d+1)]
x_min = a
x_max = b
y_min = c
y_max = d
answer_list = [x_max*y_max, x_max*y_min, x_min*y_max, x_min*y_min]
print(max(answer_list)) |
p03038 | s865616419 | Accepted | import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N, M = mapint()
As = list(mapint())
As.sort()
BC = [list(mapint()) for _ in range(M)]
BC.sort(key=lambda x: x[1])
cum = 0
for b, c in BC[::-1]:
if c<As[0]:
break
As.extend([c]*b)
cum += b
if cum>=N:
break
As.sort(reverse=True)
print(sum(As[:N])) |
p02664 | s397310986 | Accepted | #!/usr/bin/env python3
T = list(input())
cnt = 0
for i in range(len(T)):
if T[i] == '?':
T[i] = 'D'
print(''.join(T))
|
p03693 | s457843179 | Wrong Answer | r,g,b=map(int, input().split())
if (r*100+g*10+b)%4==0:
print("Yes")
else:
print('No') |
p02988 | s354734043 | Accepted | n=int(input())
p=list(map(int,input().split()))
c=0
for i in range(1,n-1):
if p[i-1] < p[i] < p[i+1] or p[i+1] < p[i] < p[i-1]:
c+=1
print(c) |
p03673 | s478937288 | Wrong Answer | import collections
n=int(input())
a=list(map(int,input().split()))
b=collections.deque()
for i,x in enumerate(a):
if i%2==1:
b.appendleft(x)
else:
b.append(x)
for i in b:
print(i) |
p02768 | s080362090 | Wrong Answer | import math
lists = list(map(int, input().split()))
n = lists[0]
a,b = lists[1],lists[2]
skip_num = [a,b]
r = 0
for i in range(1,n+1):
if i not in skip_num:
print(i)
r = r + (math.factorial(n)/(math.factorial(n-i)*math.factorial(i)))
print(r) |
p03633 | s636554485 | Accepted | def gcd(x, y):
while(x % y != 0 and y % x != 0):
if(x > y):
x = x % y
else:
y = y % x
if(x > y):
return y
else:
return x
N = int(input())
A = list()
for i in range(N):
A.append(int(input()))
ans = 1
for i in range(N):
gcd_i = gcd(A[i], ans)
ans = A[i] * ans // gcd_i
print(ans)
|
p02659 | s750764198 | Accepted | a,b=map(str,input().split())
a=int(a)
c=''
for i in b:
if i=='.':
continue
else:
c+=i
c=int(c)
print(int(a*c//100)) |
p03804 | s978857084 | Accepted | N, M = [int(i) for i in input().split()]
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
for i in range(N-M+1):
for j in range(N-M+1):
for ii in range(M):
for jj in range(M):
if A[i+ii][j+jj] != B[ii][jj]:
break
else:
continue
break
else:
print("Yes")
exit()
print("No")
|
p02730 | s760231640 | Wrong Answer | ans = "Yes"
s = input()
if s != s[::-1]: # スライスというやつ
ans = "No"
n = len(s) // 2
if s[:n] != s[0:n:-1]:
ans = "No"
print(ans) |
p03328 | s090360706 | Accepted | a,b = map(int,input().split())
print(((1+(b-a))*(b-a))//2-b)
|
p03627 | s201715802 | Wrong Answer | import collections
N = int(input())
a = collections.Counter(list(map(int,input().split())))
p = sorted([i for i in a.items() if i[1]>=2])
if len(p)<2:
print(0)
else:
print(p[-1][0]*p[-2][0]) |
p02725 | s813704667 | Accepted | K, N = map(int, input().split())
A = list(map(int, input().split()))
long = A[0] + K - A[N-1]
for i in range(N-1):
if long < A[i+1]-A[i]:
long = A[i+1]-A[i]
print(K-long) |
p03971 | s587878994 | Wrong Answer | n,a,b=map(int,input().split())
s=input()
cnt=0
for i in range(n):
if s[i] == 'a' and cnt < a+b:
print('Yes')
cnt+=1
elif s[i] == 'b' and cnt < a+b and cnt <=b:
print('Yes')
cnt+=1
elif s[i] == 'c':
print('No')
else:
print('No') |
p02596 | s843363526 | Accepted | K = int(input())
if K % 2 == 0 or K % 5 == 0:
print(-1)
exit()
i = 0
ai = 0
while True:
ai = (ai * 10 + 7) % K
i += 1
if ai == 0:
break
print(i) |
p02681 | s207128965 | Wrong Answer | S = input()
T = input()
cond = (1 <= len(S) <= 10) and len(S) == len(T) - 1
print('Yes' if cond else 'No')
|
p02760 | s345564164 | Accepted | a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
b = set(b)
g = [0]*9
for i in range(3):
for j in range(3):
if a[i][j] in b:
g[i*3+j] = 1
for i,j,k in [[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6],[0,1,2],[3,4,5],[6,7,8]]:
if g[i]==g[j]==g[k]==1:
print('Yes')
exit()
print('No') |
p02646 | s588188349 | Accepted | x,a=map(int,input().split())
y,b=map(int,input().split())
t=int(input())
if(abs(x-y)<=t*(a-b)):
print('YES')
else:
print("NO")
|
p03210 | s770935880 | Accepted | def a753(x):
return "YES" if x == 3 or x == 5 or x == 7 else "NO"
def main():
x = int(input())
print(a753(x))
if __name__ == '__main__':
main() |
p02910 | s429277002 | Wrong Answer | s = input()
print("Yes" if all(s.index(i) % 2 == 1 and i in "RUD" or s.index(i) % 2 == 0 and i in "LUD" for i in s) else "No") |
p02983 | s419646921 | Accepted | l,r=map(int,input().split())
ans = 2018
for i in range(l,r+1):
for j in range(l,r+1):
if i<j:
ans = min(ans,(i*j)%2019)
if ans == 0:
print(0)
exit()
print(ans) |
p02924 | s625695660 | Accepted | n = int(input())
print(n*(n-1)//2) |
p03555 | s564034704 | Wrong Answer | #入力例は合うがWAになる
S = input()
T = input()
if [S[0],S[1],S[2]] == [T[2],T[1],T[0]]:
print("Yes")
else:
print("No") |
p03339 | s256340136 | Accepted | n = int(input())
s = input()
sum_e = s.count("E")
sum_w = s.count("W")
cnt_e, cnt_w = 0, 0
ans = 10 ** 6
for x in s:
if x == "E":
cnt_e += 1
ans = min(ans, cnt_w + (sum_e - cnt_e))
if x == "W":
ans = min(ans, cnt_w + (sum_e - cnt_e))
cnt_w += 1
print(ans) |
p02546 | s899941160 | Accepted | s = input()
if s[-1] == 's':
print(s+'es')
else:
print(s+'s') |
p02695 | s353607117 | Accepted | import itertools
(N, M, Q) = [int(n) for n in input().split()]
reqs = []
for _ in range(Q):
a, b, c, d = [int(n) for n in input().split()]
a -= 1
b -= 1
reqs.append((a, b, c, d))
ans = 0
for A in itertools.combinations_with_replacement(range(1, M+1), N):
score = 0
for a, b, c, d in reqs:
if A[b] - A[a] == c:
score += d
ans = max(score, ans)
#print('A = {} score = {}'.format(A, score))
print(ans)
|
p02813 | s772156763 | Accepted | import itertools
n=int(input())
jyunretu=[]
for i in range(1,n+1):
jyunretu.append(str(i))
p = itertools.permutations(jyunretu, n)
jyunretulist=[]
for i in p:
jyunretulist.append(list(i))
p=input().split()
q=input().split()
for i ,youso in enumerate(jyunretulist):
if youso==p:
a=i
if youso==q:
b=i
print(abs(a-b)) |
p03150 | s203772282 | Wrong Answer | S=input()
T="keyence"
if S[:7]==T:
print("YES")
exit()
for i in range(len(S)-1):
for j in range(i,len(S)-1):
if S[:i]+S[j:]==T:
print("YES")
exit()
print("NO") |
p02911 | s704755306 | Wrong Answer | n, k, q = map(int,input().split())
a = [0 for i in range(n)]
for i in range(q):
x = int(input())
a[x-1] += 1
for i in range(n):
print("Yes" if a[i] > k else "No") |
p02606 | s994508910 | Accepted | L,R,d=map(int,input().split())
print(R//d-(L-1)//d) |
p02897 | s643430016 | Accepted | N = int(input())
print((N+1)/N/2 if N%2==1 else 1/2) |
p02732 | s236765910 | Accepted | n=int(input())
a=list(map(int, input().split()))
a_list=[0]*(n+1)
for i in a:
a_list[i]+=1
ans1=[0]*(n+1)
ans2=[0]*(n+1)
for i,m in enumerate(a_list):
if m>=2:
ans1[i]=m*(m-1)//2
ans2[i]=(m-2)*(m-1)//2
all=sum(ans1)
for i in a:
print(all-ans1[i]+ans2[i])
|
p04012 | s475463129 | Wrong Answer | w=input()
count1=0
for i in range(0,len(w)):
a=w.count(w[i])
if(a%2==0):
count1+=1
elif(a%2 != 0):
count1-=1
if(count1>0):
print("Yes")
elif(count1<0):
print("No")
|
p02835 | s912788482 | Accepted | a, b, c = map(int, input().split())
if a + b + c > 21:
print("bust")
else:
print("win") |
p03221 | s520900425 | Accepted | n,m=map(int,input().split())
a={}
s=[]
for i in range(m):
p,y=map(int,input().split())
if p not in a:
a[p]=[]
a[p].append(y)
s.append((p,y))
b={}
for i in a.keys():
a[i].sort()
for j in range(len(a[i])):
b[(i,a[i][j])]=j+1
for p,y in s:
print(str(p).zfill(6)+str(b[(p,y)]).zfill(6)) |
p02835 | s432663479 | Wrong Answer | a,b,c = map(int, input().split())
if 22 > a+b+c > 0:
print("Win")
else :
print("bust") |
p02717 | s999578101 | Accepted | a, b, c = input().split()
a, b = b, a
a, c = c, a
ans = (" ").join([a, b, c])
print(ans)
|
p02784 | s066893040 | Wrong Answer | H, N = map(int,input().split())
A_list = list(map(int, input().split()))
judge = 'Yes' if sum(A_list)>H else 'No'
print(judge) |
p03339 | s248071109 | Accepted | n = int(input())
s = input()
w = [0]*n
e = [0]*n
if s[0] == "W": w[0] = 1
else: e[0] = 1
for i in range(1,n):
if s[i] == "W":
w[i] = w[i-1]+1
e[i] = e[i-1]
else:
w[i] = w[i-1]
e[i] = e[i-1]+1
ans = float("inf")
for i in range(n):
t = 0
if i != 0: t += w[i-1]
if i != n-1: t += e[-1] - e[i]
if t < ans: ans = t
print(ans) |
p03624 | s724499213 | Accepted | S = input()
for i in range(ord('a'), ord('a') + 26):
if chr(i) not in S:
print(chr(i))
break
else:
print('None') |
p03557 | s598553890 | Accepted | import bisect
n = int(input())
a,b,c = [list(sorted(map(int, input().split()))) for _ in range(3)]
ans = 0
for i in range(n):
x = bisect.bisect_left(a, b[i])
y = len(c) - bisect.bisect_right(c, b[i])
ans += x*y
print(ans) |
p02705 | s762474829 | Accepted | from math import pi
R = int(input())
print(2*R*pi) |
p02712 | s512790766 | Wrong Answer | N = int(input())
sum = 0
for i in range(N):
if not (i%3 == 0 or i%5 == 0):
sum += i
print(sum) |
p02694 | s259394796 | Wrong Answer | x = int(input())
i = 0
a = 100
while a < x:
a += a/100
i += 1
print(i)
|
p03719 | s563536107 | Accepted | A, B, C = map(int, input().split())
if A <= C <= B:
print('Yes')
else:
print('No')
|
p02783 | s092995739 | Accepted | import math
H, A = [int(x) for x in input().split()]
print(math.ceil(H/A)) |
p03038 | s893955422 | Wrong Answer | n,m = map(int,input().split())
li = list(map(int,input().split()))
tmp_li = []
for _ in range(m):
b,c = map(int,input().split())
tmp_li.append([c,b])
tmp_li.sort(reverse=True)
#print(tmp_li)
count = 0
for t in tmp_li:
li += [t[0]]*t[1]
count += t[1]
if count + t[1]>=n:
break
li.sort(reverse=True)
print(sum(li[:n])) |
p02683 | s288926854 | Accepted | import numpy as np
N, M, X = [int(x) for x in input().split()]
books = []
ans = 10 ** 7
for i in range(N):
books.append([int(x) for x in input().split()])
books = np.array(books)
for i in range(1,2**N):
t = np.array([0]*(M+1))
for j in range(N):
if i & 1 == 1:
t = t + books[j]
i = i >> 1
s = min(t[1:])
if min(t[1:]) >= X:
if t[0] < ans:
ans = t[0]
#print(ans)
if ans == 10 ** 7:
print(-1)
else:
print(ans) |
p02778 | s024307879 | Accepted | s = input()
n = len(s)
print("x"*n) |
p03221 | s297632702 | Wrong Answer | n, m = map(int, input().split())
py = [list(map(int, input().split())) for i in range(m)]
py.sort(key=lambda x: x[1])
now = py[0][0]
count = 0
for i in range(m):
if now == py[i][0]:
count += 1
else:
now = py[i][0]
count = 1
print("{:04}".format(py[i][0]) + "{:04}".format(count)) |
p03377 | s310153450 | Wrong Answer | cat, unknown, guess = map(int, input().split())
if guess > cat:
if cat + unknown < guess:
print('NO')
else:
print('YES')
else:
if guess + unknown > cat:
print('NO')
else:
print('YES') |
p03852 | s638241092 | Wrong Answer |
c=input()
if c =="a"or"i"or"u"or"e"or"o":
print("vowel")
else:
print("consonant") |
p03328 | s345764514 | Accepted | a, b = map(int, input().split())
val = [0] * 1000
for i in range(1, 1000):
val[i] = val[i - 1] + i
n = b - a - 1
ans = val[n] - a
print(ans)
|
p03419 | s695774828 | Accepted | n, m = map(int, input().split())
if n == 1:
if m == 1:
ans = 1
else:
ans = m - 2
elif m == 1:
ans = n - 2
else:
ans = (n - 2)*(m - 2)
print(ans) |
p02838 | s123864205 | Accepted | import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))
N = int(input())
A = np.array(input().split(), np.int)
#print(A)
cnt = 0
for i in range(61):
B = (A>>i)&1
z = np.count_nonzero(B)
cnt += z*(N-z)*(2**(i))
cnt %= MOD
print(cnt)
|
p02958 | s917142850 | Wrong Answer | print("YES") |
p03127 | s985458907 | Accepted | def gcd(a, b):
while b:
a, b = b, a % b
return a
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = max(A)
for i in range(N-1):
ans = min(ans, gcd(A[i], A[i+1]))
print(ans)
|
p02705 | s831538381 | Wrong Answer | n = int(input())
print(n*3.14) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.