problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02777 | s874117556 | Accepted | s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u == s:
a -= 1
else:
b -= 1
print(' '.join((str(a), str(b)))) |
p03127 | s621994208 | Accepted | import fractions
N = int(input())
A = [int(i) for i in input().split()]
A = sorted(A)
a = A.pop(0)
for i in A:
a = fractions.gcd(a, i)
print(a) |
p02761 | s678998823 | Wrong Answer | N,M = map(int,input().split())
S = [0]*M
C = [0]*M
for i in range(M):
S[i],C[i] = map(int,input().split())
answer = -1
for i in range(10**(N-1),10**N):
numstr = str(i)
count = 0
for j in range(M):
if int(numstr[S[j]-1]) != C[j]:
break
else:
count += 1
if coun... |
p03284 | s140970891 | Accepted | n, k = map(int, input().split())
if n % k == 0:
print(0)
else:
print(1) |
p02933 | s925975719 | Accepted | a=int(input())
b=input()
if a>=3200:
print(b)
else:
print('red') |
p03109 | s943597899 | Accepted | S = input()
S = S.replace("/","")
int_S = int(S)
print("Heisei" if int_S <= 20190430 else "TBD") |
p03042 | s034850695 | Accepted | s=input()
if 12<int(s[:2]) or 0==int(s[:2]):
if 12>=int(s[2:])>=1:
print("YYMM")
else:
print("NA")
elif 1<=int(s[:2])<=12:
if 12>=int(s[2:])>=1:
print("AMBIGUOUS")
else:
print("MMYY")
|
p03997 | s387442069 | Wrong Answer | def main():
a = int(input())
b= int(input())
h = int(input())
t = abs(a-b)
ar = a*h + ((t*h)//2)
print(ar)
if __name__=="__main__":
main() |
p02546 | s388104896 | Accepted | s = input()
if s[-1] != 's':
print(s+'s')
else:
print(s+'es') |
p04012 | s301798560 | Wrong Answer | w = input()
beau = {}
for i in range(len(w)):
if not w[i] in beau:
beau[w[i]] = 1
else:
beau[w[i]] += 1
num = sum(map(lambda x: x%2,list(beau.values())))
if num == 0:
print('YES')
else:
print('NO') |
p03095 | s005740137 | Accepted | import collections
n=int(input())
s=list(input())
s=collections.Counter(s)
ans=1
for i in s:
ans*=s[i]+1
ans%=10**9+7
print(ans-1) |
p03624 | s210267413 | Accepted | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import string
s = set(input().strip())
alpha = set(string.ascii_lowercase)
s = sorted(list(alpha - s))
if s:
print(s[0])
else:
print('None')
|
p03438 | s647104239 | Wrong Answer | # input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
import math
import sys
import bisect
import heapq # 優先度付きキュー(最小値取り出し)
from collections import deque
inf = 10 ** 15
mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
suma = sum... |
p03385 | s182057743 | Wrong Answer | S = input()
print("Yes" if len(S) == 3 else "No") |
p02600 | s357238873 | Accepted | x = int(input())
if 400 <= x <= 599:
print(8)
if 600 <= x <= 799:
print(7)
if 800 <= x <= 999:
print(6)
if 1000 <= x <= 1199:
print(5)
if 1200 <= x <= 1399:
print(4)
if 1400 <= x <= 1599:
print(3)
if 1600 <= x <= 1799:
print(2)
if 1800 <= x <= 1999:
print(1) |
p02708 | s963247581 | Accepted | mod = 1000000007
N, K = map(int, input().split())
S = [0]
for i in range(N):
S.append(S[i]+i+1)
r = 1
for i in range(K, N+1):
up = S[N]-S[N-i]
low = S[i-1]
r = (r+(up-low+1))%mod
print(r) |
p03241 | s067758918 | Accepted | x,y=map(int,input().split())
a=1
k=pow(y,0.5)
for i in range(1,int(k)+1):
if y%i==0:
if i*x<=y:
a=max(a,i)
if (y//i)*x<=y:
a=max(a,y//i)
print(a) |
p03360 | s597651700 | Accepted | A, B, C = map(int, input().split())
N = int(input())
print(max(A, B, C) * (2 ** N - 1) + A + B + C) |
p03150 | s633791299 | Accepted | S=input()
sk="keyence"
N=len(S)
Nsk=len(sk)
k=0
ans="NO"
if N>=Nsk:
for i in range(Nsk):
temp=S[0:i]+S[N-Nsk+i:]
if temp==sk:
ans="YES"
print(ans) |
p03438 | s331856707 | Wrong Answer | n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
cnt = 0
for a, b in zip(A, B):
if a > b:
cnt += (a-b)*2
else:
cnt -= (b-a)
print("No" if cnt>0 else "Yes") |
p03073 | s290141507 | Accepted | S = input()
N = len(S)
count1 = 0
count2 = 0
for i in range(N):
ex = str(i % 2)
if S[i] == ex:
count1 += 1
else:
count2 += 1
print(min(count1, count2)) |
p03380 | s663488760 | Wrong Answer | N = int(input())
a = set([int(c) for c in input().split()])
a = sorted(list(a))
X = a[-1]//2+1
m = 10**9
x = 0
for i in range(N-1):
if abs(a[i]-X)<m:
m = abs(a[i]-X)
x = i
print(a[-1],a[x]) |
p03264 | s823122755 | Wrong Answer | k = int(input())
t = (k/2)**2
if k % 2 == 0:
print(t)
else:
print(round(t)) |
p02607 | s593195563 | Accepted | n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
if i%2==0:
if a[i]%2==1:
ans += 1
print(ans) |
p02843 | s095550260 | Accepted | X = int(input())
x = X % 100
tmp = (x // 5) * 105
if x % 5 != 0:
tmp += 100 + (x % 5)
if tmp > X:
print(0)
else:
print(1)
|
p04012 | s686275440 | Accepted | w=input()
for i in range(0,len(w)):
if w.count(w[i])%2==1:
print("No")
exit()
print("Yes") |
p03944 | s263605332 | Accepted | W,H,N = map(int,input().split())
XYA = [tuple(map(int,input().split())) for _ in range(N)]
xmin = 0
ymin = 0
xmax = W
ymax = H
for x,y,a in XYA:
if a == 1:
xmin = max(x,xmin)
elif a == 2:
xmax = min(x,xmax)
elif a == 3:
ymin = max(y,ymin)
else:
ymax = min(y,ymax)
#print(xmax,xmin,ymax,ymin)
pri... |
p03745 | s909072302 | Wrong Answer | N = int(input())
A = list(map(int,input().split()))
a = 0
S = 0
num = 1
for i in range(1,N):
if A[i] - A[i - 1] == 0:
a = 0
elif A[i] - A[i - 1] > 0:
a = 1
else:
a = 2
if S == 0:
S = a
elif S != a:
num += 1
S = 0
print(num)
|
p02608 | s580527993 | Accepted | n = int(input())
A = [0]*10**7
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
A[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
print(*A[1:n+1],sep='\n') |
p02882 | s454876694 | Wrong Answer | import math
a,b,x = map(int,input().split())
bottle = a * b
water = x / a
if water <= bottle / 2:
a2 = 2 * water / b
ans = math.degrees(math.atan(b / a2))
else:
b2 = 2 * water / a - b
water2 = water - (b2 * a)
b3 = water2 / a
ans = math.degrees(math.atan(b3 / a))
print(ans) |
p02947 | s911885657 | Accepted | def main():
n=int(input())
s=[]
for i in range(n):
si=list(input())
si.sort()
s.append(si)
s.sort()
s.append("X")
cnt=1
ans=0
for i in range(n):
if s[i]==s[i+1]:
cnt+=1
else:
ans+=cnt*(cnt-1)//2
cnt=1
print(a... |
p02708 | s713234209 | Wrong Answer | N,K=map(int,input().split())
M=N+1;L=K-1
print((M**3+5*M+2*L**3+3*(1-M)*L**2-(5+3*M)*L)/6%1000000007) |
p02773 | s838250804 | Wrong Answer | from collections import Counter
def main():
a=int(input())
tmp=0
x = [input() for _ in range(a)]
x.sort()
count=Counter(x)
for i in count.most_common():
if tmp <= i[1]:
print(i[0])
tmp=i[1]
else:
break
main()
|
p02814 | s007991349 | Wrong Answer | import sys,queue,math,copy
from functools import reduce
from fractions import gcd
input = sys.stdin.readline
LI = lambda : [int(x) for x in input().split()]
LI_2 = lambda : [int(x) / 2 for x in input().split()]
lcm = lambda a : reduce(lambda x, y : x * y // gcd(x,y), a)
N,M = LI()
A = LI_2()
c = lcm(A)
for i in A:
... |
p03665 | s662817827 | Accepted | n,p=map(int,input().split())
a=list(map(lambda x:int(x)%2,input().split()))
d=[0]*n
if p==1:
if a[0]==1:
d[0]=1
else:
d[0]=0
else:
if a[0]==1:
d[0]=1
else:
d[0]=2
for i in range(1,n):
if a[i]==0:
d[i]=d[i-1]+d[i-1]
else:
d[i]=d[i-1]+(2**i-d[i-1])
p... |
p03345 | s562324108 | Accepted | a,b,c,k = map(int,input().split())
ans = a - b
if k % 2 == 0:
print(ans)
else:
print(-ans) |
p03071 | s812366889 | Accepted | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
A, B = map(int, readline().split())
vec = [A, B, A-1, B-1]
vec.sort(reverse=True)
print(sum(vec[:2]))
return
if __name__ ==... |
p02785 | s958169944 | Accepted | N,K=map(int,input().split())
H=list(map(int,input().split()))
newlist=sorted(H,reverse=True)
del newlist[0:K]
print(sum(newlist)) |
p03067 | s639435704 | Accepted | a,b,c = map(int,input().split())
if a < c < b or b < c < a:
print("Yes")
else:
print("No") |
p02597 | s716475236 | Accepted | N = int(input())
C = list(input())
cnt_r = 0
for c in C:
if c == "R":
cnt_r += 1
for i in range(cnt_r):
if C[i] == "R":
cnt_r -= 1
print(cnt_r) |
p02792 | s878201507 | Wrong Answer | # -*- coding: utf-8 -*-
n=int(input())
c = 0
if n > 100:
c = int((n * n/100.0) + 8)
else:
for i in range(1,n+1):
for j in range(1,n+1):
if int(str(i)[0]) == int(str(j)[-1]) and int(str(i)[-1]) == int(str(j)[0]):
c+=1
print(c) |
p03721 | s674935299 | Accepted | N, K = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
A.sort(key=lambda x: x[0])
cnt = 0
for ab in A:
a = ab[0]
b = ab[1]
cnt += b
if cnt >= K:
print(a)
exit() |
p03208 | s387904985 | Accepted | import itertools
import math
import fractions
import functools
n, k = map(int, input().split())
h = []
for i in range(n):
h.append(int(input()))
h.sort()
subs = []
for i in range(1,n):
subs.append(h[i]-h[i-1])
amount = [0]*(n)
sums = 0
for i in range(0,len(subs)):
sums += subs[i]
amount[i+1] = sums
... |
p03524 | s683374412 | Accepted | S = input()
a = S.count('a')
b = S.count('b')
c = S.count('c')
if abs(a-b) <= 1 and abs(a-c) <= 1 and abs(b-c) <= 1:
print("YES")
else:
print("NO") |
p03632 | s037571547 | Accepted |
a,b,c,d = map(int,input().split())
if max(a,c) <= min(b,d):
print(min(b,d)-max(a,c))
else:
print(0)
|
p03042 | s479137576 | Wrong Answer | s=input()
f=int(s[:2])
b=int(s[2:4])
if b>=13 or b==0:
print('NA')
elif f>=13:
print('YYMM')
else:
print('AMBIGUOUS') |
p03795 | s668169145 | Wrong Answer | N = int(input())
FACTOR = 10 ** 9 + 7
num = 1
for i in range(1, N+1):
num *= i
k, r = divmod(num, FACTOR)
num = r
k, r = divmod(num, FACTOR)
print(r) |
p03419 | s272782637 | Accepted | N, M = map(int, input().split())
N, M = min(N, M), max(N, M)
if M == 1:
print(1)
elif N == 1:
print(M-2)
else:
print((M-2)*(N-2))
|
p02633 | s961594133 | Accepted | import sys
x=int(input())
for j in range(1,361):
for k in range(1,361):
if 360*k==x*j:
print(j)
sys.exit() |
p03481 | s754086534 | Accepted | X, Y = map(int, input().split())
num = X
cnt = 0
for i in range(1000):
if(num > Y):
break
num = num * 2
cnt += 1
print(cnt) |
p03495 | s725142393 | Wrong Answer | import sys
import collections
N=input().split()
list1=input().split()
list1=[int(i) for i in list1]
X=int(N[0])
Y=int(N[1])
aaa=[]
#print(len(set(list1)))
int1=len(set(list1))
if int1<=Y:
print(0)
sys.exit()
c = collections.Counter(list1)
CCC=sorted(c.items(), key=lambda x:x[1])
print(CCC)
#print(i... |
p03944 | s252650514 | Accepted | w,h,n = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(n)]
xmin,xmax,ymin,ymax = 0,w,0,h
for a in A:
if a[2] == 1:
xmin = max(xmin, a[0])
if a[2] == 2:
xmax = min(xmax, a[0])
if a[2] == 3:
ymin = max(ymin, a[1])
if a[2] == 4:
ymax = min(ymax, a[1])
S = (xmax-x... |
p02982 | s714084209 | Accepted | n,D = map(int,input().split())
X =[]
for _ in range(n):
x = list(map(int,input().split()))
X.append(x)
ans = 0
for i in range(n):
for j in range(i+1,n):
val = 0
for d in range(D):
val += (X[i][d]-X[j][d])**2
val = val**0.5
if val.is_integer():
ans += ... |
p03487 | s358529456 | Wrong Answer | import collections
N = int(input())
lsA = list(map(int,input().split()))
counterA = collections.Counter(lsA)
ans = 0
for i in counterA.keys():
if i == counterA[i]:
continue
ans += min(counterA[i],abs(i-counterA[i]))
print(ans) |
p03254 | s193481857 | Wrong Answer | if __name__ == "__main__":
n, x = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) == x:
print(n)
exit()
a.sort()
ans = 0
tmp = 0
for aa in a:
if tmp < x and aa <= x-tmp:
tmp += aa
ans += 1
if tmp == x:
... |
p03017 | s374338654 | Accepted | n,a,b,c,d=map(int,input().split())
s=input()
if c<d:
if s[a-1:d].find("##")!=-1:
print("No")
else:
print("Yes")
else:
if s[a-1:c].find("##")!=-1:
print("No")
else:
if s[b-2:d+1].find("...")!=-1:
print("Yes")
else:
print("No") |
p02820 | s601021580 | Accepted | n,k = [int(x) for x in input().split()]
r,s,p = [int(x) for x in input().split()]
t = list(input())
for i in range(n-k):
if t[k+i] == t[i]:
t[k+i] = 0
print(t.count("r")*p + t.count("s")*r + t.count("p")*s)
|
p02622 | s548254914 | Accepted | S = input()
T = input()
count = 0
for i in range(len(S)):
if S[i] != T[i]:
count += 1
print(count) |
p03252 | s180046404 | Accepted | s = input()
t = input()
sl = list(s)
tl = list(t)
from collections import Counter
sc = Counter(sl)
tc = Counter(tl)
sp =[]
tp =[]
alp = "abcdefghijklmnopqrstuvwxyz"
for i in alp:
sp.append(sc[i])
tp.append(tc[i])
sps =sorted(sp)
tps = sorted(tp)
for i,j in zip (sps,tps):
if i ==j:
pass
el... |
p02910 | s000853655 | Accepted | S = input()
odd = S[::2]
even = S[1::2]
if not('L' in odd) and not('R' in even):
print('Yes')
else:
print('No') |
p04031 | s659211250 | Wrong Answer | import numpy as np
n=int(input())
a=np.array([int(x) for x in input().split()])
x=[]
for i in a:
s=sum((a-i)*(a-i))
x.append(s)
print(min(x)) |
p03487 | s805489699 | Accepted | n = int(input())
a = list(map(int,input().split()))
ans = 0
from collections import defaultdict
dd = defaultdict(int)
for key in a:
dd[key] += 1
for key in dd.keys():
#print(key,dd[key])
if dd[key]>=key:
ans += dd[key]-key
else:
ans += dd[key]
print(ans) |
p03073 | s777206346 | Accepted | import sys
s = sys.stdin.readline().rstrip()
def main():
s1 = s[::2]
s2 = s[1::2]
res1 = s1.count('1') + s2.count('0')
res2 = s1.count('0') + s2.count('1')
return min(res1, res2)
if __name__ == '__main__':
ans = main()
print(ans) |
p02684 | s116826575 | Accepted | from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)
n,k = map(int,stdin.readline().rstrip().split())
a = list(map(int,stdin.readline().rstrip().split()))
a = [0]+a
bunki = 0
now = a[1]
lip = [1]
se = set()
while True:
bunki += 1
if now in se:
break
se.add(now)
lip... |
p03455 | s009367261 | Accepted | a,b=input().split()
a=int(a)
b=int(b)
ans=a*b
if (a*b)%2!=0: #odd
print('Odd')
else: #even
print('Even') |
p03427 | s813601368 | Wrong Answer | n = input()
l = len(n)
n = int(n)
if n % 10 == 0:
print((l - 1) * 9)
else:
s = list(str(n))
result = int(s[0]) - 1
result += (l - 1) * 9
print(result) |
p03799 | s955395654 | Accepted | n,m=map(int,input().split())
if n<m:
ans=n+(m-n*2)//4
print(ans)
elif 2*n>=m:
ans=m//2
print(ans)
|
p03778 | s865837702 | Accepted | #k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
W,a,b = map(int, input().split())
if (b+W < a):
print(a-(b+W))
elif (a+W < b):
... |
p03043 | s014675353 | Wrong Answer | n,k = map(int,input().split())
ans,cnt = 0,0
for i in range(1,n+1):
while(i<k):
i = i*2
cnt += 1
print(i,cnt)
ans += (1/n)*(1/2)**cnt
cnt = 0
print(ans) |
p03486 | s285717372 | Accepted | s=list(input())
t=list(input())
s="".join(sorted(s))
t="".join(sorted(t,reverse=True))
ans=sorted([s,t])
if ans[0] == s and s!=t:
print("Yes")
else:
print("No")
|
p03785 | s764485416 | Wrong Answer | N, C, K = map(int, input().split())
T = sorted([int(input()) for i in range(N)])
nw = T[0]
bs = 1
ans = 1
for i in range(1, N):
t = T[i]
if bs == C:
bs = 0
nw = t
ans += 1
elif t-nw > K:
bs = 0
nw = t
ans += 1
else:
bs += 1
else:
if bs > 0:
... |
p03352 | s635690860 | Wrong Answer | x=int(input())
print(int(x**(1/2))**2) |
p02675 | s776945031 | Accepted | n = int(input())
n = n%10
if n == 3:
print("bon")
elif n == 0 or n == 1 or n == 6 or n == 8:
print("pon")
else:
print("hon")
|
p03041 | s466286577 | Accepted | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, K = lr()
S = list(sr())
S[K-1] = S[K-1].lower()
print(''.join(S))
|
p02633 | s675530751 | Accepted | x = int(input())
for k in range(1, 361):
n = k*x/360
if n%1 ==0:
break
print(k)
|
p02939 | s900719477 | Accepted | s = input()
n = len(s)
dp = [0] * (n + 1)
dp[1] = 1
dp[2] = dp[1] + (1 if s[0] != s[1] else 0)
for i in range(2, n):
if s[i] != s[i-1]:
dp[i+1] = dp[i] + 1
else:
dp[i+1] = dp[i-2] + 2
print(dp[n]) |
p02730 | s574442121 | Accepted | S = input()
N = len(S)
S1 = S[0:(N-1)//2]
S2 = S[(N+3)//2-1:N+1]
print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else "No") |
p02760 | s955965338 | Wrong Answer | list = []
list1 = []
list2 = []
list3 = []
list5 = []
list1 = input().split()
list2 = input().split()
list3 = input().split()
list.extend(list1)
list.extend(list2)
list.extend(list3)
n = int(input())
b = 1
for i in range(0,n):
a = (input())
list5.append(a)
for item in list5:
for items in list:
... |
p03607 | s455119114 | Accepted | N = int(input())
nums = {}
for i in range(N):
n = int(input())
if n in nums.keys():
nums[n] += 1
else:
nums[n]=1
c = 0
for te in nums.values():
if te % 2 == 1:
c+=1
print(c)
|
p02923 | s344342390 | Accepted | n = int(input())
high = list(map(int,input().split()))
a = []
count = 0
for x in range(n-1):
if high[x]-high[x+1] >= 0 :
count += 1
else:
a.append(count)
count = 0
a.append(count)
print(max(a))
|
p03001 | s638718227 | Accepted | w,h,x,y=map(int,input().split())
if x==w/2 and y==h/2:
print(w*h/2,1)
else:
print(w*h/2,0)
|
p03592 | s692001356 | Accepted | N,M,K = map(int, input().split())
for n in range(N+1):
for m in range(M+1):
if n*M + m*N - 2*n*m == K:
print('Yes')
exit()
else:
print('No') |
p04029 | s663934824 | Accepted | N=int(input())
print((N*(N+1))//2) |
p02819 | s430499335 | Wrong Answer | n=int(input())
p=[i for i in range(3,n+1,2)]
p=[2]+p
prime=[2]
std=[True]*(n+1)
for i in p:
if std[i]:
if i%prime[-1]!=0:
prime.append(i)
for j in range(n//i):
std[i*j]=False
else:
continue
for i in range(n):
t=n+i
for j in prime:
if t%j==0:
break
else:
print(n+i... |
p02829 | s842681256 | Accepted | s = [0,1,2,3]
s[int(input())] = 0
s[int(input())] = 0
print(sum(s)) |
p03285 | s764785442 | Wrong Answer | n = int(input())
cnt = 0
for i in range(26):
for j in range(16):
if i * j == n:
cnt += 1
if cnt >= 1:
print("Yes")
else:
print("No") |
p03127 | s719853680 | Accepted | import math
N = int(input())
A = list(map(int, input().split()))
ans = A[0]
for a in A[1:]:
ans = math.gcd(ans, a)
print(ans) |
p02973 | s071697478 | Wrong Answer | N = int(input())
As = [int(input()) for _ in range(N)]
from bisect import bisect_right
def LIS(L):
dp = [L[0]]
length = len(L)
for i in range(1, length):
a = L[i]
if a <= dp[0]:
dp.insert(0, a)
else:
dp[bisect_right(dp, a)-1] = a
return dp
print(len(LIS(... |
p03262 | s573489993 | Accepted | N,X = list(map(int, input().split()))
x = sorted([X] + list(map(int, input().split())))
gaps = [b-a for a,b in zip(x, x[1:])]
from fractions import gcd
g1=gaps[0]
for g2 in gaps[1:]:
g1 = gcd(g1, g2)
print(g1) |
p02860 | s273173866 | Accepted | n = int(input())
s = input()
if s[0:n//2] == s[n//2:n] :
print('Yes')
else :
print('No') |
p02612 | s458785090 | Accepted | N = int(input())
print((1000 - N % 1000)%1000)
|
p02795 | s271451033 | Accepted | import math
h = int(input())
w = int(input())
n = int(input())
print(min(math.ceil(n / h), math.ceil(n / w))) |
p02996 | s719085549 | Accepted | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from operator import itemgetter
def main():
N = int(readline())
tasks = []
for _ in range(N):
a, b = map(int, readline().split())
tasks.append((a, b))
tasks.sort(key=item... |
p02613 | s179086844 | Wrong Answer | n=int(input())
c1,c2,c3,c4=0,0,0,0
for i in range(n):
s=input()
if(s=='AC'):
c1+=1
elif(s=='WA'):
c2+=1
elif(s=='TLE'):
c3+=1
else:
c4+=1
print('AC X'+' '+str(c1))
print('WA X'+' '+str(c2))
print('TLE X'+' '+str(c3))
print('RE X'+' '+str(c4)) |
p02695 | s624287154 | Accepted | from itertools import combinations_with_replacement
N,M,Q=map(int,input().split())
G=[]
for _ in range(Q):
A,B,C,D=map(int,input().split())
G.append([A,B,C,D])
max_score=0
for A in combinations_with_replacement(range(1,M+1),r=N):
score=0
for a,b,c,d in G:
if A[b-1]-A[a-1]==c:
score+=d
max_score... |
p02689 | s283466109 | Accepted | x,try_k = map(int,input().split())
input_x = input().split()
list_a = [0]*x
list_b = [[] for i in range(x)]
for i in range(len(list_a)):
list_a[i] = int(input_x[i])
for i in range(try_k):
a,b = map(int,input().split())
list_b[b-1].append(list_a[a-1])
list_b[a-1].append(list_a[b-1])
#print(list_b)
count... |
p03696 | s355785389 | Accepted | N = int(input())
S = input()
count = 0
flag = False
for index, s in enumerate(S):
if s == '(':
flag = True
count += 1
if flag and s == ')' and count != 0:
count -= 1
if not flag:
continue
if count > 0:
S += ')' * count
count = 0
flag = False
for index, s in enumerate(S[::-1]):
if s == '... |
p02854 | s444853284 | Wrong Answer | n=int(input())
a=list(map(int,input().split()))
sm=sum(a)
i=0
han=0
while sm/2>han:
if i==n-1:
break
han+=a[i]
i+=1
print(abs(2*han-sm)) |
p02645 | s144834520 | Wrong Answer | s = list(input())
for i in range(len(s)-2):
adana = s[i:i+3]
if adana[1] != "a" and adana[1] != "i" and adana[1] != "u" and adana[1] != "e" and adana[1] != "o":
continue
else:
print("".join(adana))
break |
p03062 | s456351078 | Wrong Answer | import bisect
n=int(input())
a=sorted(list(map(int,input().split())))
ind=bisect.bisect_left(a,0)
if ind==0 :
print(sum(a))
elif ind==n:
print(-sum(a)+2*a[-1])
elif ind%2==0 or a[ind]==0:
print(-sum(a[:ind])+sum(a[ind:]))
else:
print(-sum(a[:ind])+sum(a[ind:])-2*min(abs(a[ind]),abs(a[ind-1]))) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.