problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02622 | s027045691 | Wrong Answer | s=input()
t=input()
a=[0]*26
for i in range(len(s)):
a[ord(s[i])-97]+=1
for i in range(len(t)):
a[ord(t[i])-97]-=1
ans=0
for i in range(26):
ans+=abs(a[i])
print(ans//2) |
p02882 | s311441745 | Accepted | from sys import stdin
import math
a, b, x = (int(i) for i in stdin.readline().rstrip().split())
if a*a*b < 2*x:
c = math.atan(2 * b/a - 2 * x/a ** 3)
print(math.degrees(c))
else:
c = math.atan(a * b * b/(2 * x))
print(math.degrees(c))
|
p02789 | s104141560 | Wrong Answer | N,M = [int(i) for i in input().split()]
if N==M:
print("YES")
else:
print("NO") |
p03481 | s538103348 | Accepted | x, y = map(int, input().split())
ans = 0
while x <= y:
x *= 2
ans += 1
print(ans)
|
p03067 | s333723624 | Accepted | import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
a,b,c = map(int,readline().split())
if a < c < b or a > c > b:
print("Yes")
else:
print("No") |
p02819 | s135339556 | Accepted | import sys
x=int(input())
while True:
flg=False
for i in range(2,x):
if x%i==0:
flg=True
if flg==False:
print(x)
sys.exit()
else:
x+=1 |
p02628 | s023044993 | Accepted | N,K = map(int, input().split())
p_list = sorted(list(map(int, input().split())))
res = 0
for i in range(K):
res += p_list[i]
print(res)
|
p03817 | s724139176 | Accepted | #!/usr/bin/env python3
x = int(input())
print(x // 11 * 2 - (-(x % 11) // 6))
|
p02665 | s297106269 | Accepted | # -*- coding: utf-8 -*-
import sys
N, *A = map(int, sys.stdin.buffer.read().split())
def tree(A,N):
m = [A[i] for i in range(N+1)]
M = [A[i] for i in range(N+1)]
for i in range(N-1,-1,-1):
m[i] += m[i+1]//2+m[i+1]%2
M[i] += M[i+1]
if m[0]>1 or M[0]==0:
return -1
count = 1
vertex = 1
for i in... |
p02873 | s289842606 | Accepted | s = input()
n = len(s) + 1
t = [0]*n
for i in range(n-1):
if s[i] == '<':
t[i+1] = t[i] + 1
for i in range(n-2,-1,-1):
if s[i] == '>':
t[i] = max(t[i],t[i+1]+1)
print(sum(t)) |
p02695 | s053511018 | Accepted | import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
L.append(list(map(int,input().split())))
nums = [k+1 for k in range(M)]
ans = 0
for e in itertools.combinations_with_replacement(nums, N):
temp = 0
for f in L:
a, b, c, d = f[0], f[1], f[2], f[3]
if e[b-1]-e[a-1]... |
p02677 | s733790541 | Accepted | import math
A, B, H, M = map(int, input().split())
a = 30*H+0.5*M
b = 6*M
kaku = abs(a-b)
if kaku > 180:
kaku = 360-kaku
#print(kaku)
#print(math.cos(math.radians(kaku)))
ans = A*A+B*B-2*A*B*math.cos(math.radians(kaku))
print(math.sqrt(ans))
|
p03161 | s173178590 | Wrong Answer | def main():
n, k = map(int, input().split())
h = list(map(int, input().split()))
c = [0] + [abs(h[1] - h[0])]
for i in range(2, n):
min_step = 10 ** 4
num = i if i <= k else k + 1
for j in range(1, num):
step = abs(h[i] - h[i-j]) + c[i-j]
if step < min_ste... |
p02843 | s878072604 | Accepted | X=int(input())
N=X//100
if N<0:
print(0)
elif 100*N<=X<=105*N:
print(1)
else:
print(0) |
p03435 | s766127302 | Accepted | field=[]
result="Yes"
for i in range(3):
field.append(list(map(int,input().split())))
for i in range(3):
for j in range(3):
if not (field[i][j]>=0 and field[i][j]<=100*2):
result="No"
if j ==0:
pos_i0=field[i][j]
field[i][j]-=pos_i0
for j in range(3):
if not (field[0][j]==field[1][j] and f... |
p02675 | s585809695 | Wrong Answer | N = int(input("enter the number:"))
ldigit = N%10
bon = [3]
pon = [0,1,6,8]
if ldigit in bon:
print('bon')
elif ldigit in pon:
print('pon')
else:
print('hon') |
p02582 | s100746636 | Wrong Answer | user_input = input().upper()
store = []
for i in user_input:
store.append(i)
st_nd = store[0:2]
# print(st_nd)
nd_rd = store[1:3]
# print(nd_rd)
if len(set(store)) == 1:
for i in set(store):
if i == "S":
print(0)
else:
print(3)
elif len(set(st_nd)) == 1:
print(2)
elif... |
p03625 | s436552510 | Accepted | n = int(input())
a = list(map(int, input().split()))
from collections import Counter
a = Counter(a)
lis = []
for i,j in a.items():
lis += [i]*(j//2)
#print(lis)
lis.sort(reverse=True)
if len(lis) <= 1:
ans = 0
else:
ans = lis[0]*lis[1]
print(ans) |
p02600 | s003584572 | Accepted | x = int(input())
print((1999-x)//200+1) |
p02695 | s424975205 | Wrong Answer | n,m,q=map(int,input().split())
e=[list(map(int,input().split())) for _ in range(q)]
ans=0
for i in range(1<<(2*n-1)):
a=[1]
for j in range(2*n-1):
if (i>>j)&1:a[-1]+=1
else:a+=[a[-1]]
if a[-1]>m:
flag=0
break
if len(a)>n:
flag=1
break
else:flag=1
if flag==0 or len(a)<n:co... |
p02836 | s875035543 | Accepted | S = input()
l = len(list(S)) // 2
form = list(S[:l])
las = list(reversed(list(S[l:])))
count = 0
for i, e in enumerate(form):
if las[i] != e:
count += 1
print(count)
|
p02935 | s054981081 | Wrong Answer | n = int(input())
v = list(map(int, input().split()))
v_s = sorted(v)
for i in range(len(v_s)-1):
v_s[i+1] = (v_s[i] + v_s[i+1]) / 2
v_s[i] = 0
sum(v_s) |
p03657 | s259143280 | Accepted | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
de... |
p02717 | s815213567 | Accepted | x, y, z = map(int, input().split())
print(z, x, y) |
p02939 | s638412684 | Accepted | s=input()
n=len(s)
d=[s[0]]
t=0
res=''
for i in range(1,n):
res+=s[i]
if res==d[t]:
continue
else:
d.append(res)
res=''
t+=1
print(len(d)) |
p02547 | s583841298 | Accepted | N = int(input())
c = 0
for i in range(N):
a, b = map(int, input().split())
if a == b:
c += 1
else:
c =0
if c == 3:
break
if c == 3:
print("Yes")
else:
print("No")
|
p03338 | s654530543 | Accepted | input()
s = input()
m = 0
for i in range(1,len(s)):
f = s[:i]
g = s[i:]
x = set(f)
count = 0
for j in x:
if j in g:
count = count+1
m = max(count,m)
print(m) |
p03323 | s558626417 | Accepted | A,B=map(int,input().split())
if A<=8 and B<=8 :
print("Yay!")
else :
print(":(") |
p02952 | s031726564 | Wrong Answer | n = int(input())
ans = 0
if n == 100000 :
ans = 101009
elif 10000 <= n <= 99999 :
ans = n - 10000 + 1 + 1000 + 9
elif 1000 <= n <= 9999 :
ans = 1009
elif 100 <= n <= 999 :
ans = n - 100 + 1 + 9
elif 10 <= n < 99 :
ans = 9
elif 1 <= n <= 9 :
ans = n
print(ans)
|
p02731 | s462224626 | Accepted | n = int(input())
x = n/3
print(x**3) |
p03001 | s429132838 | Accepted | w, h, x, y = map(int, input().split())
c_x = w / 2
c_y = h / 2
if c_x == x and c_y == y:
print(w * h / 2, 1)
else:
print(w * h / 2, 0) |
p03611 | s718477454 | Accepted | import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
n = I()
... |
p02647 | s395337024 | Accepted | from itertools import accumulate
N, K = map(int, input().split())
A = list(map(int, input().split()))
def calc_imos(arr):
imos = [0] * (N + 1)
for i, a in enumerate(arr):
l = max(0, i - a)
r = min(N - 1, i + a)
imos[l] += 1
imos[r + 1] -= 1
imos = list(accumulate(imos))
... |
p02791 | s459036343 | Accepted | n = int(input())
p = list(map(int, input().split()))
count = 0
minimun = 2 * (10**5)+1
for i in range(n):
if(minimun >= p[i]):
count += 1
minimun = p[i]
print(count) |
p02768 | s649951325 | Wrong Answer | n,a,b=map(int,input().split())
def combination(n, a, mod):
bunshi = 1
bunbo = 1
for i in range(a):
bunshi *= n-i
bunshi = bunshi%mod
bunbo *= a-i
bunbo = bunbo%mod
return bunshi*pow(bunbo, mod-2, mod)%mod
mod = 100000007
answer = pow(2, n, mod)
answer -= 1
answer -= comb... |
p03778 | s691506268 | Accepted | W,A,B=map(int,input().split())
if A+W>=B and A<=B+W:
print(0)
else:
if B-(A+W)>=0:
print(B-(A+W))
else:
print(A-(B+W)) |
p02789 | s287443784 | Wrong Answer | #スペース区切りの整数入力
N, M = map(int, input().split(' '))
#N,Mの比較
if N==M:
print('yes')
else:
print('No')
|
p03013 | s593106312 | Accepted | n,m=map(int,input().split())
a=0
if m!=0:
a=int(input())
b=1
s=[1]*(n+1)
for i in range(1,n+1):
if i!=a:
if i-2>=0:
s[i]=(s[i-1]+s[i-2])%1000000007
else:
s[i]=s[i-1]%1000000007
elif b!=m:
s[i]=0
a=int(input())
b+=1
else:
s[i]=0... |
p03821 | s803465362 | Accepted | n = int(input())
a = []
b = []
for i in range(n):
x, y = map(int, input().split())
a.append(x)
b.append(y)
a = a[::-1]
b = b[::-1]
ans = 0
for i in range(n):
t = (a[i] + ans) % b[i]
if t != 0:
ans += b[i]-t
print(ans) |
p03486 | s653229199 | Accepted | s, t = [input() for i in range(2)]
ns = ''.join(sorted(s))
nt = ''.join(sorted(t, reverse=True))
print('Yes') if ns < nt else print('No')
|
p02596 | s984855795 | Wrong Answer | # your code goes here
x = int(input())
i = 1
n= 0
if x % 2 == 0 or x % 5 == 0:
print(-1)
else:
for i in range(1, 1000000):
l =( 7 %x*pow(9,-1)%x* (pow(10,i,x) - 1%x)%x )%x
#l=math.ceil(l)
n+=1
if l % x == 0:
break
print(n)
|
p02939 | s899010332 | Wrong Answer | S=input()
tmp=S[0]
i=1
ans=1
while i<len(S):
print(S[i],tmp)
if S[i]!=tmp:
ans+=1
tmp=S[i]
i+=1
else:
ans+=1
tmp=S[i:i+2]
i+=2
if len(S)!=1:
if S[-2]==S[-1] and tmp!=S[-2:]:
ans-=1
print(ans)
|
p02777 | s214215108 | Accepted | S,T=input().split()
a,b=[int(s) for s in input().split()]
U=input()
if S==U:
a-=1
else:
b-=1
print(*[a,b]) |
p03136 | s928255363 | Wrong Answer | num = input()
numlist = map(int, input().split())
numlistmax = max(numlist)
totalnum = sum(numlist)
if totalnum - numlistmax > numlistmax:
print("Yes")
else:
print("No") |
p03285 | s294013449 | Accepted | n = int(input())
for i in range(n//4 +1):
if (n - 4 * i) % 7 == 0:
print('Yes')
exit()
print('No') |
p02829 | s861916591 | Accepted | a = int(input())
b = int(input())
print(6-a-b) |
p04005 | s260835658 | Accepted | from sys import stdin
li = list(map(int,stdin.readline().rstrip().split()))
li.sort()
count = 0
if all(li)%2 == 1:
wake = li[2]//2
nokori = li[2]-li[2]//2
print(li[0]*li[1]*(nokori-wake))
else:
print(0) |
p02831 | s729547138 | Accepted | def gcm(a,b):
if a==0:
return b
elif b==0:
return a
else:
return gcm(a%b,b) if a>=b else gcm(a,b%a)
def lcn(a,b):
return a*b//gcm(a,b)
a,b=map(int,input().split())
print(lcn(a,b)) |
p04043 | s015026581 | Wrong Answer | ABC = [int(x) for x in input().split()]
S = sorted(ABC)
print(S)
if S[0] == 5 and S[1] == 5 and S[2] == 7:
print('YES')
else:
print('NO') |
p02959 | s687823932 | Wrong Answer | N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split())) + [0]
ans = min(A[0], B[0])
rest = B[0] - ans
for i in range(N):
#rest+B[i+1]でとA[i+1]をどれだけ倒せるか
curr = min(A[i+1], rest + B[i+1])
rest = max(0, rest + B[i+1] - curr)
ans += curr
print(ans) |
p03455 | s162217836 | Wrong Answer | a,b = map(int, input().split())
def answer(a:int, b:int):
if (a * b) % 2 == 0:
return 'Even'
else:
return 'Odd' |
p03493 | s369311441 | Accepted | x = input()
cnt = 0
for s in range(3):
if x[s] == "1":
cnt +=1
print(cnt) |
p03041 | s617449142 | Accepted | N, K = map(int, input().split())
S = list(input())
S[K-1] = S[K-1].lower()
print(''.join(S))
|
p03282 | s603294071 | Accepted | n=input()
k=int(input())
for i in range(len(n)):
if n[i]=="1" :
k-=1
if k==0 :
print(1)
break
else :
print(n[i])
break
|
p02707 | s599241039 | Wrong Answer | n = int(input())
line = list(map(int, input().strip().split(" ")))
ans = [0 for s in range(n)]
for i in line:
ans[i] += 1
for i in range(1, n):
print(ans[i])
|
p02754 | s110640020 | Accepted | N, A, B = map(int, input().split())
print(N // (A + B) * A + min(A, N % (A + B)))
|
p03827 | s516676751 | Accepted | n = int(input())
s = list(input())
x = 0
mx = 0
for a in s:
if a == "I":
x +=1
else:
x -=1
if x > mx:
mx = x
print(mx)
|
p02994 | s427519949 | Accepted | n,l=map(int,input().split())
f=1
as_=[]
m=float('inf')
for i in range(n):
a=l+i
as_.append(a)
m=min(m,abs(a))
if a<0:
f=-1
else:
f=1
print(sum(as_)-f*m)
|
p03612 | s824722370 | Accepted | N = int(input())
p = list(map(int,input().rstrip().split(" ")))
ans = 0
swap = 0
for i in range(N):
if p[i] == i + 1:
if i != N - 1:
swap = p[i]
p[i] = p[i + 1]
p[i + 1] = swap
ans += 1
else:
swap = p[i]
p[i] = p[i - 1]
... |
p03799 | s652249328 | Accepted | S,C = map(int,input().split())
p = min(S,C//2)
C -= p*2
ans = p + C//4
print(ans) |
p03254 | s227590705 | Wrong Answer | num_children, num_snacks = list(map(int, input().split(' ')))
children = list(map(int, input().split(' ')))
children.sort()
count = 0
for i in range(num_children):
if num_snacks >= sum(children[:i+1]):
count += 1
print(count)
|
p02726 | s751682505 | Wrong Answer | N, X, Y = map(int, input().split())
ans = [0] + [0]*(N-1)
for i in range(1, N):
for j in range(i+1, N+1):
diff = min(j-i, abs(i-X)+abs(j-Y)+1)
print("i={0}, j={1}".format(i, j))
print("j-i={0}, abs(i-X)+abs(j-Y)+1={1}".format(j-i, abs(i-X)+abs(j-Y)+1))
print("-----")
ans[diff] += 1
for i in rang... |
p02664 | s539421789 | Wrong Answer | t = list(input())
for i in range(len(t)):
if t[i] != "?":
continue
else:
if t[i-1] == "D":
t[i] = "P"
if t[i-1] == "P":
t[i] = "D"
if t[-1] == "?":
t[-1] = "D"
print(''.join(t))
|
p03219 | s603879754 | Accepted | x,y = map(int,input().split())
print(x+y//2) |
p02791 | s277706264 | Wrong Answer | n = int(input())
*p, = map(int, input().split())
ma = p[0]
ans = 0
for i in range(n):
if p[i] <= ma:
ans += 1
ma = p[i]
print(ans)
|
p03371 | s927315939 | Accepted | A, B, C, X, Y = map(int, input().split())
ans = 10**18
for z in range(0, max(X, Y) * 2 + 1, 2):
x, y = max(0, X - z // 2), max(0, Y - z // 2)
tmp = A * x + B * y + C * z
ans = min(ans, tmp)
print(ans)
|
p03161 | s989519466 | Accepted | # N = int(input())
N, K = [int(i) for i in input().split()]
h = [0] + [int(i) for i in input().split()]
INF = 10 ** 9
dp = [INF for i in range(N+1)]
dp[1] = 0
for j in range(1, N+1):
for i in range(1, K+1):
if j > i:
dp[j] = min(dp[j], dp[j-i] + abs(h[j] - h[j-i]))
print(dp[N])
|
p03416 | s589188063 | Wrong Answer | a,b=map(int,input().split())
c=0
for i in range(a,b+1):
s=str(i)
s=list(s)
if s==reversed(s):
c+=1
print(c)
|
p02624 | s433792733 | Accepted | N = int(input())
ans = (N*(N+1))//2
for i in range(2, N+1):
n = N // i
ans += i * ((n*(n+1))//2)
print(ans) |
p02678 | s141989572 | Accepted | import sys
from collections import deque
read = sys.stdin.read
readline = sys.stdin.readline
N, M, *AB = map(int, read().split())
graph = [[] for _ in range(N + 1)]
for A, B in zip(*[iter(AB)] * 2):
graph[A].append(B)
graph[B].append(A)
answer = [-1] * (N + 1)
queue = deque([1])
answer[1] = 0
while queue:
... |
p02880 | s101040588 | Accepted | n=int(input())
flag=0
for i in range(1,10):
for j in range(1,10):
if((i*j)==n):
flag=1
break
if(flag==1):
print('Yes')
else:
print('No') |
p03351 | s294190094 | Accepted | import sys
import os
OK = 'APPROVED'
NG = 'DENIED'
def main():
if os.getenv("LOCAL"):
sys.stdin = open("input.txt", "r")
A, B, C, D = list(map(int, sys.stdin.buffer.readline().split()))
print('Yes' if abs(A - B) <= D and abs(B - C) <= D or abs(A - C) <= D else 'No')
if __name__ == '__main__':... |
p02714 | s561732358 | Accepted | n = int(input())
s = input()
r = s.count("R")
g = s.count("G")
b = s.count("B")
count = r * g * b
for i in range(n-1):
for j in range(i + 1, i + ((n - 1 - i) // 2) + 1):
k = 2 * j - i
if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
count -= 1
print(count)
|
p02818 | s619432644 | Accepted | a,b,k = list(map(int,input().split()))
if a >= k:
print(a-k,b)
elif a < k:
print(0, max(a+b-k,0))
|
p03360 | s743229117 | Accepted | #n = int(input())
#a,b = map(int,input().split())
a_L = list(map(int,input().split()))
k = int(input())
a_L = sorted(a_L,reverse=True)
a_L[0] = a_L[0] * 2**k
#print(a_L)
print(sum(a_L)) |
p04034 | s303333352 | Wrong Answer | n, m = map(int, input().split())
s = [0] * n
s[0] = 1
b = [1] * n
for i in range(m):
x, y = map(int, input().split())
s[y-1] = s[x-1]
s[x-1] = int(b[x-1] == 1)
b[x-1] -= 1
b[y-1] += 1
ans = 0
for i in range(n):
if s[i] and b[i]:
ans += 1
print(ans)
|
p02778 | s944458369 | Accepted | s = input()
print('x' * len(s)) |
p03250 | s853201573 | Wrong Answer | a,b,c=map(int, input().split())
print(max(a,b,c)+a+b+c) |
p03087 | s003653864 | Accepted | n, q = map(int, input().split())
s = input()
acc = [0]
sum = 0
for i in range(n-1):
if s[i:i+2] == "AC":
sum += 1
acc.append(sum)
else:
acc.append(sum)
for _ in range(q):
l, r = map(int, input().split())
print(acc[r-1] - acc[l-1])
|
p02993 | s096360346 | Accepted | n=str(input())
n=list(n)
if n[0]==n[1] or n[1]==n[2] or n[2]==n[3]:
print("Bad")
else:
print("Good")
|
p02948 | s810110681 | Accepted | import heapq
n, m = map(int, input().split())
l = [[] for _ in range(m)]
for i in range(n):
a, b = map(int, input().split())
if a <= m:
l[a-1].append(b)
a = []
ans = 0
for i in range(m):
for j in l[i]:
heapq.heappush(a, (-1) * j)
if a:
ans += heapq.heappop(a) * (-1)
... |
p02748 | s456222736 | Wrong Answer | import sys
import bisect
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()
A,B,M = IL()
a = IL()
b = IL()
xyc = [IL() for i in range(M... |
p02983 | s684611517 | Wrong Answer | L,R = map(int,input().split())
l = L%2019
r = R%2019
Min_Answer = 2018
for i in range(l,r+1):
for j in range (i+1,r+1):
if i ==j:
continue
Answer = (i*j) % 2019
Min_Answer = min(Answer,Min_Answer)
print(Min_Answer)
|
p02702 | s333828509 | Accepted | S = str(input())
l = len(S)
mod = [0] * 2019
dp = 0
pw = 1
for i in range(l):
mod[dp % 2019] += 1
dp = dp + pw * int(S[-1-i])
pw = (pw * 10) % 2019
mod[dp % 2019] += 1
cnt = 0
for i in range(2019):
cnt += (mod[i]*(mod[i]-1))//2
print(cnt) |
p03994 | s298020756 | Accepted | def main():
s=list(input())
k=int(input())
i=0
while k>=0 and i<len(s)-1:
if s[i]!='a' and k>=123-ord(s[i]):
k-=123-ord(s[i])
s[i]="a"
i+=1
if i==len(s)-1:
s[-1]=chr(97+(k-(123-ord(s[i])))%26)
print("".join(s))
if __name__=="__main__":
main() |
p03323 | s122527713 | Accepted | a,b = list(map(int,input().split()))
if a<=8 and b<=8:
print("Yay!")
else:
print(":(") |
p03612 | s973226585 | Accepted | N=int(input())
P=list(map(int,input().split()))
S=["x" if P[i]==i+1 else "o" for i in range(N)]
count=0
for j in range(N-1):
if S[j]=="x":
S[j]="o"
if S[j+1]=="x":
S[j+1]="o"
count+=1
if S[N-1]=="x":
count+=1
print(count) |
p03386 | s911854970 | Accepted | a, b, c = map(int, input().split())
A = []
for i in range(c):
A.append(a+i) if a <= a+i <= b else a
j = 0
for _ in range(c):
A.append(b - j) if a <= b - j <= b else a
j += 1
A = list(sorted(set(A)))
for i in A:
print(i) |
p02791 | s431458955 | Accepted | N = int(input())
P = list(map(int,input().split()))
num = 1
min_P = P[0]
for i in range(1,N):
if P[i] < min_P:
min_P = P[i]
num += 1
print(num) |
p03555 | s851384259 | Accepted | s = input()
t = input()
print("YES" if s == t[::-1] else "NO")
|
p03860 | s513981060 | Accepted | a, b, c = list(map(str, input().split()))
print(a[0] + b[0] + c[0]) |
p03261 | s353255021 | Accepted | n = int(input())
m = []
for i in range(n):
m.append(input())
if len(set(m)) != len(m):
print("No")
exit()
for j in range(n-1):
if m[j][-1] != m[j+1][0]:
print("No")
exit()
print("Yes") |
p03448 | s408554372 | Accepted | a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for i in range(a+1):
for j in range(b+1):
for k in range(c+1):
money = 500 * i + 100 * j + 50 * k
if money == x:
cnt += 1
print(cnt) |
p03681 | s259096004 | Wrong Answer | n,m=map(int,input().split())
import math
if abs(n-m) > 1:
print(0)
else:
a=math.factorial(n)
b=math.factorial(m)
print((a*b)%(10**9+7)) |
p03386 | s893106430 | Accepted | a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)
|
p02681 | s910388479 | Accepted | ans = input()
que = input()
l = len(que)
que_s = que[:l-1]
if ans == que_s:
print("Yes")
else:
print("No") |
p03103 | s736214835 | Wrong Answer | n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
ab_sorted = sorted(ab, key=lambda x:(x[0], -x[1]))
print(ab_sorted)
num = 0
amount_of_money = 0
for i in range(n):
buy = min(ab_sorted[i][1], m-num)
num += buy
amount_of_money += ab_sorted[i][0] * buy
if num >= m:
prin... |
p02773 | s816880202 | Wrong Answer | import collections
N = int(input())
S = [input() for _ in range(N)]
S.sort()
c = collections.Counter(S)
values, counts = zip(*c.most_common())
if len(values) == 1:
print(values[0])
else:
for i in range(N):
if counts[i] == counts[0]:
print(values[i])
else:
exit() |
p02765 | s509736512 | Wrong Answer | n, r = map(int, input().split())
print(r if n >= 10 else r - (100 * (10 - n))) |
p02687 | s326493380 | Wrong Answer | S='ABC'
if S is 'ABC':
print('ARC')
else:
print('ABC') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.