problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p03323 | s092967168 | Accepted | A, B = [int(i) for i in input().split()]
if A <= 8 and B <= 8:
print('Yay!')
else :
print(':(') |
p03073 | s656617654 | Accepted | s = input()
N = len(s)
f = s[0]
c = 0
for i in range(1,N):
if i % 2 == 1:
if f == s[i]:
c+=1
else:
if f != s[i]:
c+=1
print(c) |
p02606 | s797668361 | Accepted | L,R,d = map(int,input().split())
ans = 0
for i in range(L,R+1):
if i % d == 0:
ans += 1
print(ans) |
p02983 | s726586928 | Accepted | l, r = map(int, input().split())
x = l % 2019
y = r % 2019
if x > y:
y += 2019
ans = 10 ** 7
for i in range(x, y + 1):
for j in range(x, y + 1):
if ans > (i * j) % 2019 and i != j:
ans = (i * j) % 2019
if l + 2019 < r:
ans = 0
print(ans) |
p03994 | s884710193 | Accepted | s = list(input())
k = int(input())
n = len(s)
alph_map = {chr(ord('a') + i): (26 - i) % 26 for i in range(26)}
for i in range(n):
if k >= alph_map[s[i]]:
k -= alph_map[s[i]]
s[i] = 'a'
if k > 0:
s[n-1] = chr((ord(s[n-1]) + k % 26) % 123)
print(''.join(s))
|
p03524 | s449284869 | Accepted | s = input()
a = s.count('a')
b = s.count('b')
c = s.count('c')
if abs(a-b)<=1 and abs(b-c)<=1 and abs(c-a)<=1:
print('YES')
else:
print('NO')
|
p02596 | s007620250 | Accepted | K = int(input())
F = set()
val = 7
flg = True
for i in range(K+6):
if val % K == 0:
flg = False
print(i+1)
break
F.add(val%K)
val *= 10
val += 7
val %= K
if val % K in F:
break
if flg:
print(-1) |
p02689 | s505045533 | Wrong Answer | def main():
N, M = map(int, input().split())
H = list(map(int, input().split()))
S = [list(map(int, input(_).split())) for _ in range(M)]
#LIST = [1] * N
LIST = [ 1 for _ in range(N)]
for A, B in S:
if H[A-1] >= H[B-1]: LIST[B-1] = 0
if H[A-1] <= H[B-1]: LIST[A-1] = 0
# if... |
p02784 | s010902840 | Accepted | H, N = [int(x) for x in input().strip().split()]
print('YNeos'[sum([int(x) for x in input().split()])<H::2]) |
p02646 | s796095230 | Accepted | a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a<b:
a+=v*t
b+=w*t
if a<b:
print("NO")
else:
print("YES")
else:
a-=v*t
b-=w*t
if a>b:
print("NO")
else:
print("YES")
|
p03449 | s364577092 | Wrong Answer | N = int(input())
A = [[int(i) for i in input().split()] for j in range(2)]
count = 0
Max = 0
for i in range(N):
for j in range(i+1):
count += A[0][j]
for j in range(N-i-1):
count += A[1][i+j]
Max = max(Max, count)
print(Max)
|
p02783 | s514129865 | Wrong Answer | H,A = map(int,input().split())
print(H // A + 1) |
p02838 | s186820569 | Wrong Answer | def main():
n = int(input())
A = [int(x) for x in input().split()]
ans = 0
mod = 10 ** 9 + 7
for d in range(59):
# d桁目ごとに考える
x = 0
for a in A:
if (a >> d) & 1:
x += 1
ans += x * (n-x) * 2**d
ans %= mod
print(ans)
if __name__ =... |
p02811 | s495103714 | Accepted | k, x = map(int, input().split())
if k * 500 >= x:
print("Yes")
else:
print("No")
|
p03994 | s213358560 | Wrong Answer | s=input()
ls = len(s)
k= int(input())
for i in range(ls-1):
tn = ord('z')-ord(s[i])+1
if k>=tn:
k-=tn
print('a',end='')
else:
print(s[i],end='')
ik = (k + ord(s[-1])-ord('a')) % 26
print(chr(ord('a')+ik)) |
p03013 | s993312719 | Accepted | import sys
input = sys.stdin.readline
n,m = map(int, input().split())
a = set(map(int, [input() for _ in range(m)]))
dp = [0] * (n+1)
#`dp[i] = i段目にいる通り数`
if not 0 in a:
dp[0] = 1
if not 1 in a:
dp[1] = 1
for i in range(2,n+1):
if i in a:
dp[i] = 0
else:
dp[i] += (dp[i-1] + dp[i-2... |
p02701 | s356064179 | Wrong Answer | S = input()
N = len(S)
print(N)
cnt = 0
for i in range(N):
for j in range(i+4, N+1):
if int(S[i:j]) % 2019 == 0:
cnt += 1
print(cnt)
|
p03910 | s127702697 | Accepted | from sys import stdin
n = int(stdin.readline().rstrip())
point = 0
for i in range(1,n+1):
point += i
if point >= n:
sa = point-n
for k in [j for j in range(1,i+1) if j != sa]:print(k)
break |
p02665 | s671316313 | Accepted | N = int(input())
A = [0]+list(map(int, input().split()))
ans = 0
tree = []
presum = 0
for i, elt in enumerate(A[:0:-1]):
presum += elt
tree += presum,
vertices = []
last = .5
for i,elt in enumerate(tree[::-1]):
last = min(2*(last-A[i]), elt)
ans += int(last)
if last <= 0:
break
if last > 0 a... |
p02836 | s578364189 | Wrong Answer | S = input()
count = 0
leng = len(S)
for i in range(0,int(leng/2)):
if(S[i] != S[leng-i-1]):
print(S[i])
count+=1
print("%d"%(count))
|
p04031 | s056312195 | Wrong Answer | n=int(input())
a=list(map(int,input().split()))
ans=float("inf")
for i in range(-100,100):
k=0
for j in a:
k+=(j-i)**2
ans=min(ans,k)
print(ans) |
p03774 | s176630002 | Wrong Answer | n,m=map(int,input().split())
a=[list(map(int,input().split())) for a in range(n)]
c=[list(map(int,input().split())) for b in range(m)]
dist=0
minnum=0
for indi,i in enumerate(a):
dist=0
min=10*14
for indj,j in enumerate(c):
dist+=abs(i[0]-j[0])
dist+=abs(i[1]-j[1])
if min>dist:
... |
p03360 | s932050989 | Wrong Answer |
a = list(map(int,input().split()))
k = int(input())
a[-1] = a[-1] * (2**k)
print(sum(a))
|
p03145 | s052383265 | Accepted | c,a,b = map(int, input().split())
print(int(a*c/2))
|
p02880 | s757480830 | Accepted | n = int(input())
numlist = [1,2,3,4,5,6,7,8,9]
flag = False
for i in numlist:
ans1 = n / i
for j in numlist:
ans2 = ans1 / j
if ans2 == 1:
flag = True
if flag:
print('Yes')
else:
print('No') |
p03131 | s471832383 | Accepted | def resolve():
K,A,B = map(int,input().split())
if A>=B or K<=A:
print(K+1)
return
nokori = K-A+1
diff = B-A
sc = A+ + diff*(nokori//2) +(1 if nokori%2 ==1 else 0)
print(max(sc,K+1))
resolve()
|
p02947 | s824840169 | Accepted | N=int(input())
S=[]
for _ in range(N):
s=input()
S.append("".join(sorted(s)))
#S.append(sorted(s))
#print(S)
re=0
dt={}
for i in range(N):
if S[i] in dt:
dt[S[i]]+=1
else:
dt[S[i]]=1
for v in dt.values():
if v>=2:
v-=1
re+=(v*(v+1)//2)
print(re)
|
p03469 | s229266606 | Accepted | s = input()
print(s.replace(s[3], '8', 1)) |
p02838 | s583945527 | Wrong Answer | import numpy as np
n=int(input())
a=np.array(list(map(int, input().split())))
sum=0
for i in range(60):
x= np.count_nonzero(a>>i & 1)
sum+=x*(n-x)<<i
print(int(sum%(1e9+7))) |
p03206 | s851735600 | Accepted | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
d = int(readline())
if d == 22:
print('Christmas Eve Eve Eve')
elif d == 23:
print('Christmas Eve Eve')
elif d == 24:
print('Christmas Eve')
else:
print('Christmas') |
p03730 | s428629578 | Accepted | a, b, c = map(int, input().split())
tmp = []
x = a
i = 1
while x % b != 0:
x = a * i
tmp.append(x % b)
i += 1
if c in tmp:
print('YES')
else:
print('NO') |
p03073 | s659472900 | Accepted | s = input()
# 0, 2, 4, ..., 2n 番目がeven_position
even_position_nums = s[::2]
len_even = len(even_position_nums)
odd_position_nums = s[1::2]
len_odd = len(odd_position_nums)
# 辞書のほうが計算量的に良い(毎度O(n)かかっている)
# evenを0、oddを1にする
tmp = len_even - even_position_nums.count('1')
tmp1 = len_odd - odd_position_nums.count('0')
first ... |
p03221 | s054182653 | Accepted | n,m = map(int,input().split())
p = {str(i):[] for i in range(1,n+1)}
l = []
for i in range(m):
t = input().split()
l.append((t[0],int(t[1])))
p[t[0]].append(int(t[1]))
for i in range(1,n+1):
i = str(i)
p[i].sort()
d = {}
for j in range(len(p[i])):
d[p[i][j]] = str(i).zfill(6)+str(j+1... |
p04044 | s254633347 | Accepted | from typing import List
def answer(n: int, l: int, s: List[str]) -> str:
return ''.join(sorted(s))
def main():
n, l = map(int, input().split())
s = [input() for _ in range(n)]
print(answer(n, l, s))
if __name__ == '__main__':
main() |
p03644 | s652509496 | Wrong Answer | n=int(input())
k=1
while n>k:
k=k*2
print(k) |
p02982 | s503704225 | Accepted | #n=int(input())
n,d=map(int,input().split())
#l=list(map(int,input().split()))
xl=[list(map(int,input().split())) for i in range(n)]
ans=0
import math
for i in range(n):
for j in range(n):
if i>=j:
continue
total=0
for k in range(d):
total+=(xl[i][k]-xl[j][k])**2
... |
p02780 | s655853442 | Accepted | n, k =map(int, input().split())
p = list(map(int, input().split()))
lista = [(i + 1) / 2 for i in p]
listb = [0]
ans = 0
for i in range(n):
listb.append(lista[i] + listb[i])
for i in range(n - k + 1):
ans = max(ans, listb[i + k] - listb[i])
print(ans) |
p03994 | s982634348 | Wrong Answer | alphabet = 'abcdefghijklmnopqrstuvwxyz'
s = input()
K = int(input())
ans = ''
for i in range(len(s) - 1):
s_i = alphabet.index(s[i])
if 26 - s_i < K:
K -= 26 - s_i
s_i = 0
ans += alphabet[s_i]
s_i = (alphabet.index(s[-1]) + K) % 26
ans += alphabet[s_i]
print(ans) |
p02730 | s393914460 | Wrong Answer | S = input()
N = len(S)
pre = S[0 : int((N-1)/2)]
print(pre)
bck = S[int((N+1)/2) : N]
print(bck)
if S == S[::-1] and pre == pre[::-1] and bck == bck[::-1]:
print("Yes")
else:
print("No") |
p03417 | s021034288 | Wrong Answer | N,M = map(int,input().split())
if N == 1:
print(M-2)
else:
print((N-2)*(M-2)) |
p02675 | s503026128 | Accepted | a=input()
a=str(a)
b=a[len(a)-1]
if b=='2' or b=='4' or b=='5' or b=='7' or b=='9':
print('hon')
elif b=='0' or b=='1' or b=='6' or b=='8':
print('pon')
else:
print('bon') |
p03282 | s593898848 | Wrong Answer | s=input()
k=int(input())
if k==1:
print(int(s[0]))
elif int(s[0])==1:
num=1
for i in range(1, len(s)):
if int(s[i])!=1:
num=int(s[i])
break
print(num)
elif int(s[0])!=1:
print(int(s[0])) |
p02583 | s794797877 | Accepted | N = int(input())
L = list(map(int, input().split()))
L2 = list(set(L)) # 重複を削除
ans = 0
for i in range(len(L2)):
for j in range(i+1, len(L2)):
for k in range(j+1, len(L2)):
l = [L2[i], L2[j], L2[k]]
l = sorted(l, reverse = True)
if l[0] < l[1] + l[2]:
ans += L.count(L2[i]) * L.count(L2... |
p02584 | s911764351 | Accepted | X,K,D=map(int,input().split())
Y=X%D
if abs(X)-K*D>0:
ans=abs(X)-K*D
else:
Z=(K-abs(Y-X)//D)%2
if Z==0:
ans=Y
else:
ans=Y-D
print(abs(ans)) |
p02823 | s327456564 | Accepted | n,a,b = list(map(int, input().split()))
if abs(b-a)%2==0:
print(abs(b-a)//2)
else:
#卓1に行くコスト
c1=max(a,b)-1
#卓Nに行くコスト
c2=n-min(a,b)
ans=0
cost=min(c1,c2)
if c1<c2:
ans+=min(a,b)-1
else:
ans+=n-max(a,b)
cost-=ans
ans+=(cost+1)//2
print(ans) |
p03910 | s982466038 | Accepted | import sys
input = sys.stdin.readline
n = int(input())
cnt = 0
ans = []
for i in range(1, n + 1):
cnt += i
ans.append(i)
if cnt >= n:
if cnt > n:
ans.remove(cnt - n)
for j in range(len(ans)):
print(ans[j])
exit()
|
p03695 | s687815668 | Accepted | import sys
import bisect
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split()]
ls = [i * 400 - 1 for i in range(1, 9)]
_set = set()
n_max = 0
for a in a_ls:
ind = bisect.bisect_left(ls ,a)
if ind == 8:
n_max += 1
else:
_set.add(ind)
_min = len(_set) if len(_set) > 0 else len... |
p02731 | s792572406 | Accepted | #!/usr/bin/env python3
import sys
def solve(L: int):
print(L*L*L/27)
return
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)
def main():
def iterate_tokens():
for line in sys.stdi... |
p02970 | s053052653 | Wrong Answer | n,d = map(int,input().split())
print((n//(d*2+1))+1) |
p02631 | s492410442 | Accepted |
def resolve():
N = int(input())
A = list(map(int, input().split()))
S = 0
for i in range(N):
S ^= A[i]
for i in range(N):
A[i] ^= S
print(*A)
if __name__ == "__main__":
resolve() |
p02659 | s190364737 | Accepted | from decimal import Decimal, ROUND_DOWN
A, B = input().split()
X = Decimal('0')
A = Decimal(A)
B = Decimal(B)
X = (A*B).quantize(Decimal('0'), rounding=ROUND_DOWN)
print(X) |
p02720 | s415050994 | Accepted | K=int(input())
from collections import deque
q=deque([i for i in range(1,10)])
for i in range(K-1):
tmp=q.popleft()
if tmp%10!=0:
q.append(10*tmp+(tmp-1)%10)
q.append(10*tmp+tmp%10)
if tmp%10!=9:
q.append(10*tmp+(tmp+1)%10)
print(q.popleft())
|
p03000 | s674232193 | Accepted | a=list(map(int,input().split()))
b=list(map(int,input().split()))
no=1
for i in range(1,a[0]):
b[i]+=b[i-1]
for i in range(0,a[0]):
if(a[1]>=b[i]):
no+=1
else:
break
print(no) |
p03131 | s857744523 | Accepted | import sys
def input(): return sys.stdin.readline().rstrip()
def main():
k,a,b=map(int,input().split())
if b-a<=2 or k<=a:
print(k+1)
else:
print(a+(b-a)*((k-a+1)//2)+(k-a+1)%2)
if __name__=='__main__':
main() |
p02953 | s443666084 | Wrong Answer | #import math
#import bisect
#import numpy as np
#import itertools
#import copy
import sys
ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)
def main():
n = int(input())
h = list(map(int,ipti().split()))
for i in range(1, n):
if h[i] - h[i-1] <= 0:
... |
p02924 | s556424955 | Accepted | N = int(input())
print((N * (N-1)) // 2) |
p03145 | s720770973 | Wrong Answer | a,b,c=map(int,input().split())
print(a*b%2) |
p02765 | s877502205 | Wrong Answer | s=str(input())
if s== 'AAA' or s=='BBB':
print('No')
else:
print('Yes') |
p04011 | s822433078 | Wrong Answer | n = list(input())
for i in n:
if n.count(i)%2 != 0:
print("N0")
exit()
print("Yes")
|
p03565 | s285863949 | Accepted | s, t = raw_input(), raw_input()
def f(a,b):
if len(a) != len(b): return False
for u,v in zip(a,b):
if u != v and u != '?':
return False
return True
cand = -1
for i in range(len(s)):
if f(s[i:i + len(t)],t):
cand = i
if cand == -1:
print 'UNRESTORABLE'
else:
print s[:cand].replace('?', 'a') + t + s[cand+l... |
p02817 | s170291903 | Accepted | t,s = input().split()
print(s+t) |
p03679 | s301561335 | Accepted | import sys
input = sys.stdin.readline
def main():
X, A, B = map(int, input().split())
if B <= A:
ans = "delicious"
elif B <= A + X:
ans = "safe"
else:
ans = "dangerous"
print(ans)
if __name__ == "__main__":
main()
|
p03804 | s247870650 | Accepted | n,m=map(int,input().split())
a=[list(input()) for _ in range(n)]
b=[list(input()) for _ in range(m)]
eq = False
find = False
for i in range(n-m+1):
for j in range(n-m+1):
for p in range(m):
for q in range(m):
if a[p+i][q+j] == b[p][q]:
eq = True
else:
eq = False
... |
p02836 | s352130106 | Wrong Answer | s=input()
print(sum(s[i]!=s[-1-i])for i in range(len(s)//2)) |
p02775 | s244135845 | Accepted | n = [0] + list(map(int, list(input())))
ans = 0
c_in = 0
while n:
s = n.pop()
s += c_in
if 0 <= s <= 4:
ans += s
c_in = 0
elif 6 <= s:
ans += abs(10 - s)
c_in = 1
else:
ans += 5
if 5 <= n[-1]:
c_in = 1
else:
c_in = 0
p... |
p02972 | s055617162 | Accepted | import sys
input = sys.stdin.readline
N=int(input().rstrip('\n'))
As = [int(x) for x in input().rstrip('\n').split()]
res = [0]*N
for i in range(N,0,-1):
now = sum(res[i-1::i])%2
if now!=As[i-1]:
res[i-1] += 1
print(sum(res))
print(*[x+1 for x in range(N) if res[x]>0]) |
p03351 | s385326764 | Accepted | a,b,c,d = map(int,input().split())
if abs(a - c) <= d or (abs(a - b) <= d and abs(b - c) <= d):
print('Yes')
else:
print('No') |
p03665 | s708877992 | Accepted | N,P = map(int,input().split())
A = list(map(int,input().split()))
if all(a%2==0 for a in A):
print(0 if P else 2**N)
else:
print(2**(N-1)) |
p03556 | s279066403 | Wrong Answer | N = int(input())
ans = 0
for i in range(N):
if i*i <= N: ans = i*i
else: break
print(ans)
|
p03106 | s115948870 | Accepted | a, b, k = map(int, input().split())
c = 1
for i in range(min(a, b) + 1, 0, -1):
if a % i == 0 and b % i == 0:
if c == k:
print(i)
c += 1 |
p02880 | s568709539 | Accepted | n = int(input())
def ok(x):
for i in range(1,10):
for j in range(1,10):
if i*j==x:
return True
break
if ok(n)==True:
print("Yes")
else:
print("No") |
p03803 | s270676982 | Accepted | # -*- coding: utf-8 -*-
"""
Created on Thu May 14 17:01:05 2020
@author: shinba
"""
a,b = map(int,input().split())
if a == 1:
if b == 1:
print("Draw")
else:
print("Alice")
elif b == 1:
print("Bob")
else:
if a > b:
print("Alice")
elif b > a:
print("Bob")
else:
... |
p02947 | s869352260 | Accepted | import sys
import collections
def solve():
readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
n = int(readline())
s = ["".join(sorted(str(readline().rstrip().decode('utf-8')))) for _ in range(n)]
s = collections.Counter(s).most_common()
t = 0
for k, v in s:
if v > 1:
... |
p03324 | s730922109 | Accepted | d,n=map(int,input().split())
print(pow(100,d)*n if n<100 else pow(100,d)*101) |
p02684 | s866587609 | Accepted | n,k=map(int,input().split())
a=list(map(int,input().split()))
now=0
visited=set()
visited.add((0))
visited2=[0]
while True:
k-=1
now=a[now]-1
if k==0:
print(now+1)
exit()
if now in visited:
visited.add((now))
visited2.append(now)
break
visited.add((now))
visited2.append(now)
x... |
p03760 | s174892454 | Wrong Answer | O = input()
E = input()
ans = ''
for o, e in zip(O, E):
ans += o+e
print(ans)
|
p03457 | s298955319 | Accepted | n = int(input())
st = 0
sx, sy = 0, 0
ng = False
for _ in range(n):
t, x, y = map(int, input().split())
dt = (t - st)
dx = abs(sx - x)
dy = abs(sy - y)
if dt%2 == (dx+dy)%2 and dx+dy <= dt:
st = t
sx = x
sy = y
else:
ng = True
break
print('No' if ng else ... |
p03062 | s574493962 | Wrong Answer | N = int(input())
A = list(map(int, input().split()))
for i in range(len(A)-1):
before = A[i] + A[i+1]
after = -1*A[i] + (-1)*A[i+1]
if A[i] >= 0 and i != len(A)-1:
continue
if A[i] < 0 and i != len(A)-1:
A[i] *= -1
A[i+1] *= -1
continue
if after >= before:
A[i] *= -1
A[i+1] *= -1... |
p02688 | s864770621 | Wrong Answer | n, k = map(int, input().split())
kids = list()
for i in range(k):
d = input()
kids += list(map(int, input().split()))
res = 0
print(kids)
for i in range(1,n+1):
if i not in kids:
res+= 1
print(res) |
p03456 | s906773516 | Accepted | import math
a,b=input().split()
c=int(a+b)
if int(math.sqrt(c))**2==c:
print("Yes")
else:
print("No") |
p03338 | s480741549 | Wrong Answer | N = int(input())
S = list(input())
maxCommon = 1
for i in range(1, N-1):
commonNum = len(list(set(S[0:i]) & set(S[i:])))
if commonNum > maxCommon:
maxCommon = commonNum
print(maxCommon)
|
p03543 | s403893479 | Wrong Answer | a=set(input())
if len(a)<=2:
print('Yes')
else:
print('No') |
p03943 | s034038807 | Wrong Answer | a=list(map(int,input().split()))
if max(a)*2==sum(a):
print("YES")
else:
print("NO") |
p03329 | s422834985 | Accepted | N = int(input())
memo = [-1]*(N+1)
import sys
sys.setrecursionlimit(10**8)
def rec(n):
if n == 0:return 0
if memo[n] != -1:return memo[n]
res = float('inf')
pow6 = 1
while pow6 <= n:
res = min(res,rec(n-pow6)+1)
pow6 *= 6
pow9 = 1
while pow9 <= n:
res = min(res,rec... |
p02866 | s880650640 | Accepted | N = int(input())
D = list(map(int, input().split()))
dp = [0] * N
for i in D:
dp[i] += 1
ans = 1 if dp[0] == 1 and D[0] == 0 else 0
for i in range(1, N):
ans *= dp[i-1] ** dp[i]
ans %= 998244353
print(ans) |
p02706 | s879502180 | Wrong Answer | n, m = map(int, input().split())
A = list(map(int, input().split()))
for a in A:
if n < 0:
print(-1)
break
n -= a
else:
print(n) |
p02724 | s212677794 | Accepted | s = int(input())
c = s // 500
d = s % 500
e = d //5
h = c*1000 + e*5
print(h) |
p02777 | s577720261 | Accepted | s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if s == u:
print(a - 1, b)
else:
print(a, b - 1) |
p03042 | s645356360 | Wrong Answer | s=input()
fs=int(s[:2])
ls=int(s[2:])
if 1<=fs<=12 and 13<=ls:
print('MMYY')
elif 1<=fs<=12 and 1<=ls<=12:
print('AMBIGUOUS')
elif fs>=13 and 1<=ls<=12:
print('YYMM')
else:
print('NA')
|
p03059 | s123966964 | Accepted | A,B,T=map(int, input().split())
tmp=int(T/A)
print(tmp*B) |
p02731 | s818346133 | Wrong Answer | l = int(input())*10
Ma = 0
for i in range(1, l+1, 1):
for j in range(1, l-i+1, 1):
z = l - (i+j)
result = z*i*j
if(result>Ma):
Ma = result
print(Ma/1000) |
p03761 | s676375127 | Wrong Answer | # coding: utf-8
from collections import Counter
alp = "abcdefghijklmnopqrstyvwxyz"
S = []
count = {}
for a in alp:
count[a] = 51
N = int(input())
for i in range(N):
s = input()
S.append(s[:])
ans = []
for a in alp:
cnt = 0
min_ = 10**9
for s in S:
if a in s:
cnt += 1
... |
p02818 | s722837072 | Accepted | a, b, k = map(int, input().split())
if a - k > 0:
a = a - k
elif a - k < 0:
if b - (k - a) > 0:
b = b - (k - a)
a = 0
else:
b = 0
a = 0
else:
a = 0
print(a, b) |
p02802 | s714158279 | Accepted | def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
ans,pena=0,0
N,M=MI()
P=[0]*N
PENA=[0]*N
for i in range(M):
p,s=input().split()
p=int(p)
p-=1
if s=='AC':
if P[p]==0:
ans+=1
P[p]=1
if PENA[p]!=0:
pena+=PENA[p]... |
p02996 | s008100184 | Accepted | n = int(input())
ab = []
for i in range(n):
ai, bi = map(int,input().split())
abi = [ai,bi]
ab.append(abi)
sorted_ab = sorted(ab,key=lambda x : x[1])
fin = 0
for j in range(n):
fin += sorted_ab[j][0]
if fin > sorted_ab[j][1]:
print("No")
quit()
print("Yes") |
p02912 | s037272806 | Accepted | import sys
import heapq
from bisect import insort_right
input = sys.stdin.readline
N, M = map(int, input().split())
A = list(map(int, input().split()))
A = [-a for a in A]
heapq.heapify(A)
for i in range(M):
tmp = heapq.heappop(A)
heapq.heappush(A,int(tmp/2))
print(sum([-a for a in A])) |
p03095 | s656112458 | Accepted | _=input()
s=input()
ans=1
for i in set(s):
ans*=s.count(i)+1
ans%=10**9+7
print(ans-1) |
p02594 | s643321464 | Accepted | X = int(input())
print('Yes' if X >= 30 else 'No')
|
p03659 | s116282936 | Wrong Answer | N=int(input())
a=list(map(int,input().split()))
ans=10**9+10
s=sum(a)
now=0
snuke=0
for i in range(N-1):
snuke+=a[i]
now=s-2*snuke
ans=min(abs(now),ans)
print(ans) |
p03013 | s493018698 | Accepted | from collections import deque
CONST = 1000000007
n,m = map(int,input().split())
lis = deque([int(input()) for _ in range(m)])
lis.append(n+1)
nhole = lis.popleft()
memo = deque([0, 1])
for i in range(1,n+1):
if i == nhole:
memo.append(0)
nhole = lis.popleft()
else:
memo.append((memo[-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.