problem_id stringclasses 428 values | submission_id stringlengths 10 10 | status stringclasses 2 values | code stringlengths 5 816 |
|---|---|---|---|
p03672 | s487419983 | Accepted | S = input()
while True:
S = S[:-2]
if S[:len(S)//2] == S[len(S)//2:]:
print(len(S))
exit() |
p02601 | s785898784 | Wrong Answer | A,B,C = map(int, input().split())
K = int(input())
D = B
E = C
i1 = 0
i2 = 0
while(D<=A):
D = D*2
i1 +=1
while(E<=D):
E = E*2
i2 +=1
if K >= i1+i2+1:
print("Yes")
else:
print("No") |
p02627 | s027404223 | Wrong Answer | a=input()
print("A" if a.isupper else "a") |
p02939 | s292031698 | Wrong Answer | s = input()
# aabbaa
ans = 1 if s[-1] != s[-2] else 0
prev = ""
i = 0
while i < len(s) - 1: # i < 4
if prev != s[i]:
ans += 1
prev = s[i]
i += 1
else:
ans += 1
prev = s[i:i+2]
i += 2
print(ans)
|
p02743 | s535155414 | 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')
|
p02916 | s672365186 | Accepted | n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
now=-2
for a in A:
ans+=B[a-1]
if a==now+1:
ans+=C[now-1]
now=a
print(ans) |
p04044 | s647173305 | Wrong Answer | n,m = map(int , input().split())
li=[]
for i in range(n):
li.append(input())
sorted(li)
st=''
for e in li:
st=st+e
print(st) |
p02873 | s995438294 | Accepted | S = input()
A = [0] * (len(S) + 1)
for i in range(len(S)):
if S[i] == "<":
A[i + 1] = max(A[i + 1], A[i] + 1)
for i in reversed(range(len(S))):
if S[i] == ">":
A[i] = max(A[i], A[i + 1] + 1)
print(sum(A))
|
p02602 | s502904866 | Accepted | def main():
N, K = map(int, input().split())
A = list(map(int, input().split()))
for i in range(K, len(A)):
if A[i-K] < A[i]:
print("Yes")
else:
print("No")
if __name__ == '__main__':
main()
|
p02842 | s473365652 | Accepted | import math
N = int(input())
ans = math.ceil(N/1.08)
if math.floor(ans * 1.08) != N:
print(':(')
else:
print(ans)
# print(math.ceil(N/1.08))
# print(int(math.ceil(N/1.08)*1.08)) |
p02629 | s449509419 | Wrong Answer | n=int(input())
num=n
shisuu=1
ans=""
while num>0:
num-=26**shisuu
shisuu+=1
for i in range(shisuu-2,-1,-1):
ans+=chr(ord("a")-1+n//(26**i))
n=n%(26**i)
print(ans) |
p02917 | s849510723 | Wrong Answer | n = int(input())
b = list(map(int,input().split()))
ans = 0
aa = 0
ab = 0
for i in range(n-1):
aa = min(ab,b[i])
ab = b[i]
ans += aa
print(ans+ab) |
p02754 | s861516287 | Accepted | NAB = list(map(int, input().split()))
cluster = NAB[1] + NAB[2]
q, mod = divmod(NAB[0], cluster)
q *= NAB[1]
q += NAB[1] if (NAB[1] < mod) else mod
print(q) |
p02939 | s825088482 | Wrong Answer | txt = list(input())
count = 1
hitotsu = True
a = txt.pop(0)
while(len(txt) != 0):
#print(txt, count)
if hitotsu:
if a != txt[0]:
a = txt.pop(0)
gitotsu = True
else:
if len(txt) >= 2:
a = txt.pop(0)
a += txt.pop(0)
hitotsu = False
count += 1
else:
count += 1
break
else:
a = txt.pop(0)
hitotsu = True
count += 1
print(count) |
p02720 | s623087549 | Wrong Answer | K = int(input())
def lunlun(n):
x = str(n)
if len(x)==1:
return True
else:
for i in range(len(x)-1):
if abs(int(x[i])-int(x[i+1]))>1:
return False
else:
return True
i = 0
j = 0
while i<K:
if lunlun(j):
i +=1
j += 1
print(j) |
p03627 | s102843898 | Accepted | # coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline
n,*a = map(int,read().split())
a.sort()
res = []
while a and len(res) < 2:
#print(a,res)
if len(a) >= 2 and a[-1] == a[-2]:
res.append(a[-1])
a.pop()
a.pop()
else:
a.pop()
#print(res)
if len(res) == 2:
print(res[0]*res[1])
else:
print(0) |
p02705 | s592995114 | Accepted | R = int(input())
ennsyuu = R * 6.28318530717958623200
print(ennsyuu) |
p02859 | s382551269 | Wrong Answer | print(int(int(input())*2)) |
p02718 | s798765757 | Accepted | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 4 21:05:12 2020
@author: Kanaru Sato
"""
n,m = list(map(int, input().split()))
a = list(map(int, input().split()))
sum = 0
for i in range(len(a)):
sum += a[i]
a.sort(reverse=True)
if a[m-1] < sum/(4*m):
print("No")
else:
print("Yes") |
p02600 | s037590770 | Accepted | def solve():
X = int(input())
lower = 400
upper = 599
rank = 8
for _ in range(8):
if lower <= X <= upper:
print(rank)
return
lower += 200
upper += 200
rank -= 1
if __name__ == '__main__':
solve() |
p03711 | s800780326 | Accepted | x, y = list(map(int, input().split()))
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]
if ((x in a) and (y in a)) or ((x in b) and (y in b)) or ((x in c) and (y in c)):
print("Yes")
else:
print("No") |
p03821 | s155812006 | Wrong Answer | n = int(input())
a = []
b = []
for i in range(n):
a_num, b_num = map(int, input().split())
a.append(a_num)
b.append(b_num)
cnt = 0
for i in reversed(range(n)):
if a[i] % b[i] == 0:
continue
r = (a[i] + cnt) // b[i] + 1
#print('a', a[i]+ cnt, b[i], r)
cnt += r * b[i] - (a[i] + cnt)
#print('c', r * b[i], a[i] + cnt, cnt)
print(cnt) |
p03434 | s943127118 | Accepted | n=int(input())
*a,=map(int,input().split())
a.sort(reverse=True)
A=a[::2]
B=a[1::2]
print(sum(A)-sum(B)) |
p03486 | s624515223 | Accepted | s=sorted(input())
t=sorted(input(),reverse=True)
print("Yes" if s<t else "No") |
p03380 | s045623368 | Accepted | from bisect import bisect
n = int(input())
a = list(map(int, input().split()))
a.sort()
i = bisect(a, (a[-1]+1) // 2)
if a[i] - a[-1] / 2 < a[-1] / 2 - a[i-1]:
print(a[-1], a[i])
else:
print(a[-1], a[i-1]) |
p02603 | s695359564 | Wrong Answer | n = int(input())
a = list(map(int, input().split()))
stock = 0
money = 1000
for i in range(n-1):
if a[i] < a[i+1]:
stock = money // a[i]
money -= stock * a[i]
elif a[i] > a[i+1]:
money += stock * a[i]
stock = 0
money += stock * a[n-1]
print(money) |
p03419 | s497009055 | Accepted | n, m = map(int,input().split())
if n == 1 and m == 1:
print(1)
elif n == 1 and m == 2:
print(0)
elif n == 2 and m == 1:
print(0)
elif n == 1:
print(m-2)
elif m == 1:
print(n-2)
elif n == 2 or m == 2:
print(0)
else:
print((m-2)*(n-2)) |
p03106 | s031168097 | Accepted | a,b,k = map( int,input().split() )
i = min(a,b)
ans = 0
while 1:
if not(a % i) and not(b % i):
ans += 1
if ans == k:
break
i -= 1
print(i)
|
p02548 | s883414863 | Wrong Answer | import math
N = int(input())
cnt = 0
root = math.sqrt(N)
if float.is_integer(root):
finish = int(root-1)
else:
finish = int(root)
root = int(root)
if root<2:
z = root+1
else:
z = root
for a in range(1,z):
# print(a, (N-1)//a - a)
cnt += (N-1)//a - a
if root<2:
print(cnt*2+finish)
else:
print(cnt*2+finish)
|
p03625 | s070114742 | Accepted | n = int(input())
A = tuple(map(int, input().split()))
A = sorted(A, reverse=True)
from collections import Counter
CA = Counter(A)
b = 0
for a in A:
if CA[a] >= 2:
CA[a] -= 2
b = a
break
c = 0
for a in A:
if CA[a] >= 2:
c = a
break
print(b*c) |
p02719 | s895717256 | Accepted | N, K = map(int, input().split())
cand1 = N % K
cand2 = K - (N % K)
print(min(cand1, cand2)) |
p02817 | s588817346 | Wrong Answer | S, T = input().split()
print(S + T) |
p02659 | s084277304 | Wrong Answer | import sys
#sys.exit()
#sorted( ,reverse=True)
#N = int(input())
A,B = map(str, input().split())
A = int(A)
B = B.replace('.','')
B = int(B)
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]
C = A * B / 100
#cnt = 0
#cnt += 1
#print(N)
#print(A,B)
#print(A*B)
#print(A*B/100)
#print(C)
#print(A)
#print('Yes')
#print('No')
print(int(C))
|
p02705 | s563122732 | Accepted | import math
r = int(input())
print(2*r*math.pi) |
p03059 | s967046747 | Accepted | A, B, T = map(int, input().split())
print(int((T+0.5)//A * B))
|
p02773 | s925696198 | Wrong Answer | import collections
n = int(input())
s = []
for i in range(n):
s.append(input())
s.sort()
most = collections.Counter(s)
most_ans = most.most_common()
most_cnt = most_ans[0][1]
for i in most_ans:
if most_cnt == i[1]:
print(i[0])
|
p02683 | s391343280 | Accepted | import numpy as np
n, m, x = map(int, input().split())
lst = np.array([np.array(list(map(int, input().split()))) for _ in range(n)])
ans = float('inf')
for i in range(1<<n):
eff = np.array([0] * (m+1))
for j in range(n):
if i>>j&1==1:
eff += lst[j]
cost = eff[0]
eff = eff[1:]
if np.all(eff >= x):
ans = min(ans, cost)
if ans == float('inf'):
print(-1)
else:
print(ans) |
p02601 | s009278708 | Accepted | A, B, C = map(int, input().split())
K = int(input())
ans = "No"
def ABC(int1, int2, int3):
if int1 < int2 < int3:
return True
else:
return False
if ABC(A, B, C):
ans = "Yes"
else:
for k in range(K):
if B <= A:
B = B * 2
elif C <= B:
C = C * 2
if ABC(A, B, C):
ans = "Yes"
break
print(ans) |
p02723 | s184920304 | Accepted | s = input()
if s[2] == s[3] and s[4] == s[5]:
print('Yes')
else:
print('No') |
p03485 | s789825634 | Accepted | import math
a, b = map(int, input().split())
print(math.ceil((a+b)/2)) |
p03264 | s882160897 | Accepted | K=int(input())
if K%2==0:
print(K//2*K//2)
else:
print((K//2)*((K//2)+1))
|
p03359 | s566198647 | Wrong Answer | a, b = map(int, input().split())
if a >= b:
print(a)
else:
print(a-1) |
p03617 | s661528282 | Accepted | Q, H, S, D = map(int, input().split())
N = int(input())
l = min(Q*4, H*2, S)
ll = min(l*2, D)
res = N//2*ll
if N % 2 == 1:
res += l
print(res) |
p03408 | s874181056 | Accepted | N=int(input())
s=[input() for i in range(N)]
M=int(input())
t=[input() for i in range(M)]
s2=list(set(s))
counter=0
for i in range(len(s2)):
if s.count(s2[i])-t.count(s2[i])>counter:
counter=s.count(s2[i])-t.count(s2[i])
print(counter)
|
p02786 | s245785783 | Wrong Answer | import math
H = int(input())
monster_num = 1
attack = 0
while H > 1:
attack = attack + monster_num * 1
H = math.ceil(H/2)
monster_num = monster_num * 2
print(monster_num + attack) |
p03013 | s471349148 | Accepted | def main():
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
ways = [0] * (N+1)
ways[0] = 1
for i in range(1, N+1):
if i not in A:
ways[i] = ways[i-1] + ways[i-2]
print(ways[N] % 1000000007)
if __name__ == '__main__':
main() |
p02711 | s780808345 | Wrong Answer | n = int(input())
a = n % 10
b = ((n - a) // 10) % 10
c = ((n - a - 10 * b) // 10) % 10
if (a == 7 or b == 7 or c == 7) :
print("Yes")
else:
print("No")
|
p03012 | s373328596 | Accepted | N = int(input())
W = list(map(int, input().split()))
ans = float('inf')
for i in range(N):
l = sum(W[:i])
r = sum(W[i:])
if ans > abs(l-r):
ans = abs(l-r)
print(ans)
|
p02690 | s467080272 | Wrong Answer | X = int(input())
for A in range(100):
B5 = A**5-X
for B in range(-100, 100):
if B**5 == B5:
print(A, B)
exit() |
p03555 | s676266801 | Accepted | a=input()
b=input()
if a[::-1]==b:
print("YES")
else:
print("NO") |
p02755 | s708170558 | Wrong Answer | from math import ceil
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
A,B = map(int, readline().split())
x1 = ceil(A / 0.08)
x2 = ceil(B / 0.1)
print(x1, x2)
if int(x1 * 0.1) == B:
print(x1)
elif int(x2 * 0.08) == A:
print(x2)
else:
print(-1)
if __name__ == "__main__":
main()
|
p02570 | s217694850 | Accepted | # スペース区切りの整数の入力
D, T, S = map(int, input().split())
#積計算
# times = a*b
# 出力
if S*T < D:
print("No")
else:
print("Yes") |
p03324 | s422865157 | Accepted | d,n=map(int, input().split())
print(100**d*n if n!=100 else 100**d*(n+1)) |
p02768 | s034045512 | Accepted | n,a,b = map(int,input().split())
def modComb(n,r,mod):
tmp = 1
r = min(r,n-r)
for i in range(1,r+1):
tmp = tmp * (n-i+1) % mod
tmp = tmp * pow(i,mod-2,mod)
return tmp % mod
mod = 10**9+7
ans = pow(2,n,mod) - 1
print((ans-modComb(n,a,mod)-modComb(n,b,mod)) % mod)
|
p02681 | s419838220 | Accepted | n = input()
m = input()
if len(n) + 1 == len(m) and n == m[:len(n)]:
print('Yes')
else:
print('No') |
p03359 | s940568826 | Accepted | a, b = map(int, input().split())
cnt = a-1
if a <= b:
cnt += 1
print(cnt) |
p02603 | s522874356 | Accepted | N=int(input())
A=list(map(int,input().split()))
money=1000
for i in range(N-1):
stock=0
if A[i]<A[i+1]:
stock=money//A[i]
money+=(A[i+1]-A[i])*stock
print(money) |
p03319 | s450129447 | Accepted | N, K = map(int, input().split())
A = list(map(int, input().split()))
a = A.index(1)
ans = int((N-2) / (K-1)) + 1
print(ans) |
p03803 | s227332716 | Accepted | A, B = map(int, input().split())
A = (A + 11) % 13
B = (B + 11) % 13
print('Alice' if A > B else ('Bob' if B > A else 'Draw')) |
p02881 | s320149847 | Accepted | import numpy as np
ans=1000000000000
N=int(input())
for i in range(1,int(np.sqrt(N)+1)):
if (N%i==0):
j=N//i
move=(i-1)+(j-1)
ans=min(ans,move)
print(ans) |
p02833 | s153911780 | Accepted | N = int(input())
ans = 0
if N % 2 == 0:
num = 5
temp_N = N//2
while num <= temp_N:
ans += temp_N//num
num *= 5
print(int(ans)) |
p04045 | s385035496 | Accepted | n,k=map(int,input().split())
d=list(map(int,input().split()))
for i in range(n,n*10+1):
if all(d.count(int(j))==0 for j in str(i)):
print(i)
exit() |
p02712 | s645786814 | Wrong Answer | n = int(input())
ans = 0
for i in range(n):
if i % 3 != 0 and i % 5 != 0:
ans += i
print(ans)
|
p02748 | s704225456 | Accepted | a, b, m = map(int, input().split())
aa = list(map(int, input().split()))
bb = list(map(int, input().split()))
x = [list(map(int, input().split())) for _ in range(m)]
ln = []
for i in range(m):
ln.append(aa[x[i][0] - 1] + bb[x[i][1] - 1] - x[i][2])
ln.append(min(aa) + min(bb))
print(min(ln)) |
p03760 | s724616549 | Wrong Answer | O = input()
E = input()
print(''.join(S+T for S,T in zip(O,E))) |
p03042 | s068009949 | Wrong Answer | S = list(input())
ans = []
A = int(S[0] + S[1])
B = int(S[2] + S[3])
if (1 <= A <= 12 and 1 <= B <= 12):
print("AMBIGUOUS")
elif (1 <= A <= 12 and 13 <= B <= 99):
print("MMYY")
elif (1 <= B <= 12 and 13 <= A <= 99):
print("YYMM")
else:
print("NA")
|
p03797 | s387357131 | Accepted | N, M = map(int, input().split())
print(M // 2 if N >= M // 2 else N + (M-N*2)//4) |
p03131 | s543821738 | Wrong Answer | K, A, B = map(int, input().split())
if A >= B+2:
print(K+1)
else:
ans = 1 + (K-A+1) * ((B-A) // 2) + (B-A)%2
print(max(K+1,ans)) |
p03324 | s158431785 | Accepted | def main():
D, N = map(int, input().split())
h = 100
if N == 100:
print((100**D)*101)
else:
print((100 ** D)*N)
main() |
p03943 | s608358883 | Accepted | a, b, c = map(int, input().split())
if a+b == c or a+c == b or b+c == a:
print('Yes')
else:
print('No') |
p03804 | s759614863 | Wrong Answer | import numpy as np
N, M = map(int, input().split())
A = np.array([[i for i in input()] for j in range(N)])
B = np.array([[i for i in input()] for j in range(M)])
found = False
for i in range(N-M+1):
for j in range(N-M+1):
P = A[i:i+M,j:j+M]
if (P == B).all():
print("Yes")
found = True
break
if not found:
print("No") |
p02899 | s925386762 | Wrong Answer | N = int(input())
A = list(map(int,input().split()))
num = {}
ans = []
for i in range(1,len(A)+1):
num[A[i-1]]=i
print(num)
num = sorted(num.items())
print(num)
for k,v in num:
ans.append(str(v))
print(' '.join(ans)) |
p03013 | s707232626 | Wrong Answer | import sys
MOD = 10 ** 9 + 7
n, m, *broken = map(int, sys.stdin.read().split())
broken = set(broken)
def main():
ways = [0] * (n + 1)
ways[0] = 1
ways[1] = not 1 in broken
for i in range(2, n + 1):
ways[i] = (not i in broken) * (ways[i-1] + ways[i-2]) % MOD
print(ways[n])
if __name__ == '__main__':
main() |
p02813 | s635998985 | Accepted | import itertools
n = int(input())
p_list = list(map(int, input().split()))
q_list = list(map(int, input().split()))
result = list(itertools.permutations([i for i in range(1, n+1)], n))
# 中身がtuppleなのでlistに変換
result = list(map(lambda x: list(x), result))
a = result.index(p_list)
b = result.index(q_list)
print(abs(a-b))
|
p02694 | s177035902 | Accepted | X=int(input())
i=100
year=0
while i<X:
i+=i//100
year+=1
print(year) |
p03037 | s474492279 | Wrong Answer | N, M = map(int, input().split())
idcard = [[int(j) for j in input().split()] for i in range(M)]
for i in range(1,M):
idcard[i] = [idcard[i][0], idcard[i-1][1]]
print(idcard[M-1][1]-idcard[M-1][0] + 1)
|
p02860 | s861595702 | Accepted | def main():
N = int(input())
S = list(input())
if N%2 != 0:
print("No")
else:
N = N//2
if S[:N] == S[N:]:
print("Yes")
else:
print("No")
return 0
if __name__ == '__main__':
main() |
p02744 | s799503739 | Wrong Answer | import itertools
n = int(input())
cl = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", ]
rl = itertools.product(cl[:n], repeat=n - 1)
if not rl:
print("a")
else:
for r in rl:
print("".join(["a"] + list(r)))
|
p03673 | s722448501 | Wrong Answer | import sys
read_=sys.stdin.buffer.readline
N=int(read_())
A=input().split()
if len(A)==1:
print(A[0])
exit()
B1=A[::2]
B2=A[1::2]
print(B1,B2)
if N%2==0:
B2.reverse()
B2.extend(B1)
print(' '.join(B2))
else:
B1.reverse()
B1.extend(B2)
print(' '.join(B1)) |
p02618 | s961256658 | Accepted | # -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
def zz():
return list(map(int, sys.stdin.readline().split()))
def z():
return int(sys.stdin.readline())
def S():
return sys.stdin.readline()
def C(line):
return [sys.stdin.readline() for _ in range(line)]
D = z()
C = zz()
S = defaultdict(list)
for i in range(D):
S[i+1] = zz()
for i in range(D):
print(np.argmax(S[i+1]) + 1)
|
p03328 | s146017467 | Accepted | import sys
input = sys.stdin.readline
def main():
a, b = map(int, input().split())
height = sum(list(range(b-a)))
print(height - a)
if __name__ == '__main__':
main()
|
p02780 | s287806750 | Wrong Answer | N, K = map(int, input().split())
p_list = list(map(int, input().split()))
c_s_list = [] #Cumulative sum_list
c_sum = 0 #Cumulative sum
for dice in p_list:
average = (dice + 1) / 2 #ダイスの期待値
c_sum += average
c_s_list.append(c_sum)
ans = 0
for i in range(N-K):
tmp = c_s_list[i+K] - c_s_list[i]
if tmp >= ans:
ans = tmp
print(ans)
|
p03013 | s885079092 | Accepted | n,m=map(int,input().split())
mList=set([int(input()) for _ in range(m)])
dp=[0]*(n+1)
dp[0]=1
if 1 not in mList:
dp[1]=1
for i in range(2,n+1):
if i in mList: continue
dp[i]+=dp[i-1]
dp[i]+=dp[i-2]
dp[i]%=1000000007
print(dp[n])
|
p02939 | s812704190 | Accepted | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
s = input()
prev = ""
ans = 0
n = len(s)
i = 0
while i<n:
if s[i]==prev:
if i+1<n:
ans += 1
prev = s[i]+s[i+1]
i += 2
else:
prev = s[i]
i += 1
ans += 1
# print(prev)
print(ans) |
p03319 | s137036011 | Wrong Answer | import math
N, K = map(int, input().split())
A = list(map(int, input().split()))
L = A.index(1)
R = N - (L + 1)
ans = math.ceil(L/(K-1)) + math.ceil(R/(K-1))
print(ans) |
p03481 | s563509102 | Accepted | X,Y=list(map(int,input().split()))
i=1
while Y>=2**i*X:
i=i+1
print(i) |
p02795 | s443109082 | Wrong Answer | H = int(input())
W = int(input())
N = int(input())
if W >= H:
print((N - N % H)// W + 1)
else:
print((N - N % W)// H + 1) |
p02760 | s727903256 | Accepted | a = list(list(map(int,input().split())) for _ in range(3))
n = int(input())
b = list(int(input()) for _ in range(n))
for i in range(3):
for j in range(3):
if a[i][j] in b:
a[i][j] = 0
for i in range(3):
if a[i][0] == a[i][1] == a[i][2] or a[0][i] == a[1][i] == a[2][i] or a[0][0] == a[1][1] == a[2][2] or a[2][0] == a[1][1] == a[0][2]:
print("Yes")
break
else:
print("No") |
p03379 | s385626120 | Accepted | n=int(input())
x=list(map(int,input().split()))
y=sorted(x[:])
l=y[n//2-1]
r=y[n//2]
for xx in x:
print(l if xx>=r else r) |
p03796 | s618512062 | Accepted | import sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def main():
N = int(input())
ans = math.factorial(N)%MOD
print(ans)
if __name__ == '__main__':
main() |
p02790 | s976393236 | Accepted | a, b = map(int, input().split())
n1 = int(str(a)*b)
n2 = int(str(b)*a)
if a >= b:
print(n2)
else:
print(n1) |
p02833 | s182640858 | Wrong Answer | n = int(input())
cnt = 0
if n%2!=0:
print(0)
else:
n = n//2
tp = 5
while n>=tp:
cnt += n//tp
tp *=5
print(cnt)
|
p02899 | s889926063 | Accepted | N=int(input())
A=list(map(int,input().split()))
L=[0]*N
for i in range(N):
L[A[i]-1]=i+1
L=[str(a) for a in L]
print(' '.join(L)) |
p02713 | s700030068 | Accepted | from math import gcd
if __name__ == '__main__':
n = int(input())
count = 1
result = 0
while count <= n:
for i in range(1, n + 1):
for j in range(1, n + 1):
# print(f"gcd({count}, {i}, {j})")
result += gcd(count, gcd(i, j))
count += 1
print(result) |
p02663 | s598121632 | Accepted | h1, m1,h2,m2,k = map(int, input().split())
hm=(h2*60+m2)-(h1*60+m1)-k
print (hm) |
p02717 | s943694319 | Accepted | x,y,z = map(int,input().split())
print(z,x,y) |
p03339 | s972875643 | Accepted | n = int(input())
s = input()
chg = [0]*n
cnt = 0
for i in range(1, n): # 左側から
if s[i-1] == 'W':
cnt += 1
chg[i] += cnt
cnt = 0
for i in range(1, n): # 右側から
if s[-i] == 'E':
cnt += 1
chg[-1-i] += cnt
print(min(chg)) |
p03284 | s639684960 | Accepted | n, k = map(int, input().split())
if n%k == 0:
print(0)
else:
print(1) |
p02771 | s827921987 | Accepted | A, B, C = map(int, input().split())
if len(set([A, B, C])) == 2:
print('Yes')
else:
print('No')
|
p02613 | s152275093 | Wrong Answer | x=int(input())
b=0;
lst=[]
acs=0
was=0
res=0
tles=0
while(b<x):
new=input()
lst.append(new)
b+=1
for c in lst:
if(c=='AC'):
acs+=1
if(c=='WA'):
was+=1
if(c=='RE'):
res+=1
if(c=='TLE'):
tles+=1
print('AC x '+str(acs))
print('WA x '+ str(was))
print('RE x ' +str(res))
print('TLE x ' +str(tles))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.