problem_id stringclasses 428 values | submission_id stringlengths 10 10 | status stringclasses 2 values | code stringlengths 5 816 |
|---|---|---|---|
p02801 | s904904423 | Accepted | s = input()
print(chr(ord(s) + 1))
|
p02771 | s064167623 | Accepted | # ABC 155: A – Poor
n = [int(s) for s in input().split()]
print('Yes' if n.count(n[0]) == 2 or n.count(n[1]) == 2 or n.count(n[2]) == 2 else 'No') |
p02983 | s168127770 | Wrong Answer | l, r = map(int, input().split())
rem = []
mod = 2019
if r - l + 1 > 2019:
ans = 0
else:
for i in range(l, r+1):
rem.append(i % mod)
rem.sort()
ans = rem[0]*rem[1] % mod
# print(rem[0], rem[1])
print(ans) |
p03778 | s995849186 | Accepted | W,a,b=map(int,input().split())
if a<=b:
if a+W<=b:
print(b-W-a)
else:
print(0)
else:
if b+W<=a:
print(a-W-b)
else:
print(0) |
p02783 | s925692586 | Wrong Answer | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
H, A = list(map(int,readline().split()))
print(H // A + 1)
|
p03555 | s179877093 | Wrong Answer | data1 = list(map(str, input().split()))
data2 = list(map(str, input().split()))
count = len(data1) - 1
sw = 0
i = 0
j = len(data2)-1
while i <= count:
if data1[i] == data2[j]:
sw += 1
print(data1[i],data2[j])
i += 1
j -= 1
if sw == len(data1):
print("Yes")
else:
print("No")
|
p04031 | s664274393 | Accepted |
if __name__ == "__main__":
N = int(input())
a_str = list(map(int, input().split(" ")))
min_a = min(a_str)
max_a = max(a_str)
min = float("inf")
ans = 0
for i in range(min_a, max_a):
temp = sum(list(map(lambda x: (x - i)**2, a_str)))
if min > temp:
min = temp
ans = temp
print(ans)
|
p02719 | s385782563 | Accepted | N,K = map(int,input().split())
N %= K
print(min(N,K-N)) |
p02861 | s831436873 | Accepted | N=int(input())
P= [tuple(map(int,input().split())) for i in range(N)]
from math import sqrt
def d(p1,p2):
x1,y1=p1
x2,y2=p2
return sqrt((x1-x2)**2 + (y1-y2)**2)
s=0
n=0
import itertools
from functools import reduce
for p in itertools.permutations(P):
s += sum( [ d(p[i],p[i+1]) for i in range(N-1) ] )
n+=1
print(s/n)
|
p03281 | s686534918 | Accepted | n = int(input())
c = 0
for i in range(1,n+1):
cc = 0
if i % 2 == 1:
for j in range(1,i+1):
if i % j == 0:
cc += 1
if cc == 8:
c += 1
print(c)
|
p02659 | s537709583 | Wrong Answer | import decimal
decimal.getcontext().prec = 5
S = input().split()
A = int(S[0])
B = float(S[1])
B = decimal.Decimal(B)
print(int((A*B)/1))
|
p03449 | s231251005 | Wrong Answer | N = int(input())
candies_i = list(map(int, input().split()))
candies_j = list(map(int, input().split()))
l = []
count = -1
for i in range(N):
count+=1
total_li = sum(candies_i[:count])
total_lj = sum(candies_j[count:])
total = total_li + total_lj
l.append(total)
print(max(l))
|
p03632 | s269124206 | Accepted | _input_list = list(map(int, input().split(" ")))
a = _input_list[0]
b = _input_list[1]
c = _input_list[2]
d = _input_list[3]
alice_push_time = set(list(range(a, b + 1)))
bob_push_time = set(list(range(c, d + 1)))
both_push_time = len(alice_push_time & bob_push_time)
if both_push_time > 0:
both_push_time -= 1
print(both_push_time) |
p02989 | s279663404 | Wrong Answer | N = int(input())
D = list(map(int, input().split()))
SD = sorted(D)
m = len(D) // 2
med = (SD[m - 1] + SD[m]) // 2
l, h = 0, 0
for d in SD:
if d < med:
l = d
elif h == 0:
l = min(med, l + 1)
h = d
break
if h != l:
print(h - l + 1)
else:
print(0)
|
p04019 | s971963352 | Accepted | S = input()
if S.count('N') > 0 and S.count('S') == 0 or S.count('N') == 0 and S.count('S') > 0 or S.count('W') > 0 and S.count('E') == 0 or S.count('W') == 0 and S.count('E') > 0:
print('No')
else:
print('Yes')
|
p02554 | s132580968 | Wrong Answer | n = int(input())
mod = 10 ** 9 + 7
re = (10 ** n) - (2 * (9 ** n)) + (8 ** n)
if n == 1:
print(0)
else:
print(re)
|
p02843 | s492403631 | Accepted | X = int(input())
dp = [False] * (X + 1)
dp[0] = True
for i in range(X):
if dp[i]:
for x in [100, 101, 102, 103, 104, 105]:
if i+x <= X:
dp[i+x] = True
if dp[-1]:
print(1)
else:
print(0) |
p03605 | s294915049 | Accepted | a = list(map(int, list(input())))
if all(a[i]!=9 for i in range(len(a))):
print("No")
else:
print("Yes") |
p03861 | s236664088 | Wrong Answer | a, b, x = map(int, input().split())
i = a
j = b
while i % x != 0:
i+= 1
while j % x != 0:
j-= 1
ans = (j- i)/ x+ 1
if(ans<= 0):
print(0)
else:
print(int(ans)) |
p03767 | s032323020 | Accepted | n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
count = 0
for i in range(n, 3*n, 2):
count += a[i]
print(count)
|
p02612 | s832807788 | Accepted | N=int(input())
if N%1000:
print(1000-N%1000)
else:
print(0) |
p02598 | s864203640 | Accepted | from sys import stdin
from math import floor,ceil
N, K = map(int, input().rstrip().split())
A = [int(x) for x in stdin.readline().rstrip().split()]
def is_max_len_less_than_input(x,K,A):
count = 0
if x==0:
return False
for ln in A:
count += ceil(ln/x)-1
if count > K:
return False
return True
def binary_search(begin,end,K,A):
while abs(end-begin)>1:
mid = (begin+end)//2
if is_max_len_less_than_input(mid,K,A):
end = mid
else:
begin = mid
return end
print(binary_search(0,max(A),K,A)) |
p02973 | s808852294 | Accepted | from collections import deque
from bisect import bisect_left
N = int(input())
A = [int(input()) for i in range(N)]
X = deque([])
for a in A:
i = bisect_left(X,a)
if i == 0:
X.appendleft(a)
else:
X[i-1] = a
print(len(X)) |
p03524 | s012748465 | Accepted | s = input()
n = len(s)
a = 0
b = 0
c = 0
for i in range(n):
if s[i] == 'a':
a += 1
elif s[i] == 'b':
b += 1
else:
c += 1
min_num = min(a,b,c)
a -= min_num
b -= min_num
c -= min_num
if a <= 1 and b <= 1 and c <= 1:
print('YES')
else:
print('NO') |
p02797 | s310739530 | Accepted | N,K,S = map(int,input().split())
if S == 10**9:
ans = [str(S)]*K + ["1"]*(N-K)
else:
ans = [str(S)]*K + [str(S+1)]*(N-K)
print(" ".join(ans)) |
p02748 | s829094856 | Accepted | A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
xyc=[]
for _ in range(M):
x,y,c=map(int,input().split())
xyc.append([x,y,c])
mi=min(a)+min(b)
for i in range(M):
e=xyc[i][0]-1
f=xyc[i][1]-1
g=xyc[i][2]
h=a[e]+b[f]-g
mi =min(mi,h)
print(mi)
|
p02947 | s131243469 | Wrong Answer | import math
n = int(input())
d = {}
ans = 0
for i in range(n):
s = str(input())
s = "".join(sorted(list(s)))
if s in d:
d[s] += 1
else:
d[s] = 1
for j in d.values():
if j == 1:
pass
else:
ans += math.factorial(j)//2
print(ans) |
p02683 | s784630124 | Wrong Answer | n,m,x=map(int,input().split())
lis=[list(map(int,(input().split()))) for i in range(n)]
c=10**5+1
p=0
for i in range(1,2**n+1):
al=[0]*m
cost=0
for j in range(n):
if (i>>j)&1:
for k in range(m):
al[k]+=lis[j][k]
cost+=lis[j][0]
if min(al)>=x:
c=min(c,cost)
p=1
print(c) if p==1 else print(-1) |
p03137 | s764768820 | Wrong Answer | n,m = map(int, input().split())
x = sorted(list(map(int, input().split())))
print(sum(sorted([abs(x[i+1]-x[i]) for i in range(m-1)])[:-(n-1)])) |
p03208 | s117259422 | Accepted | n,k = map(int,input().split())
h = sorted([int(input()) for i in range(n)])
res = [0]*(n-k+1)
for i in range(n-k+1):
res[i] = h[i+k-1]-h[i]
print(min(res)) |
p03377 | s526042298 | Wrong Answer | a,b,x = map(int,(input().split()))
if a <= x <= b:
print("YES")
else:
print("NO") |
p04044 | s230928370 | Accepted | N,L=map(int,input().split())
S=[input() for i in range(N)]
S=sorted(S)
print("".join(S))
|
p03457 | s294601244 | Accepted | N = int(input())
t0, x0, y0 = 0, 0, 0
for i in range(N):
t, x, y = map(int, input().split())
kyori = abs(x - x0) + abs(y - y0)
time = t - t0
if (abs(kyori - time)) % 2 == 0 and time - kyori >= 0:
t0, x0, y0 = t, x, y
else:
print('No')
exit(0)
print('Yes')
|
p02797 | s998783736 | Accepted | N, K, S = map(int, input().split())
A = [S] * K
A.extend([S + 1 if S < 10**9 else 1] * (N - K))
print(" ".join(str(a) for a in A)) |
p04043 | s497659839 | Wrong Answer | A, B, C = map(int, input().split())
s = A, B, C
print('Yes') if s.count(5) == 2 and s.count(7) == 1 else print('No') |
p02598 | s312727498 | Accepted | def check(N,target,A,K):
cnt = 0
for i in range(N):
cnt += -(-A[i]//target)-1
if cnt>K:
return False
return True
def solve():
ans = 0
N, K = map(int, input().split())
A = list(map(int, input().split()))
low = 1
high = 10**9+1
mid = (low+high)//2
while high>low+1:
if check(N,mid,A,K):
high = mid
else:
low = mid
mid = (low+high)//2
if check(N,low,A,K):
ans = low
else:
ans = high
return ans
print(solve()) |
p02854 | s717580022 | Accepted | N = int(input())
A = list(map(int, input().split()))
ans = float('inf')
l_sum = 0
r_sum = sum(A)
for i in range(N):
l_sum += A[i]
r_sum -= A[i]
ans = min(ans, abs(r_sum - l_sum))
print(ans) |
p02693 | s259953270 | Wrong Answer | k = int(input())
a,b = list(map(int,input().split()))
flag=False
for i in range(a,b+1):
if i % k == 0:
flag =True
if(flag):
print('OK')
else:
print('NO') |
p03208 | s253437705 | Accepted | n,k = map(int,input().split())
h = []
for i in range(n):
hi = int(input())
h.append(hi)
h.sort()
min = 10**100
for i in range(n-k+1):
if min > h[k+i-1]-h[i]:
min = h[k+i-1]-h[i]
print(min)
|
p03625 | s324257360 | Wrong Answer | n=int(input())
a=list(map(int,input().split(' ')))
x=0
y=0
a.sort()
a.reverse()
for i in range(len(a)-1):
if a[i]==a[i+1]:
x=a[i]
p=i+1
break
if x!=0:
for i in range(p,len(a)-1):
if a[i]==a[i+1]:
y=a[i]
break
print(x*y) |
p02687 | s001868591 | Wrong Answer | import sys
sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline
def solve():
s = list(input())
a = ('ABC')
if s == a:
print('ARC')
else:
print('ABC')
if __name__ == '__main__':
solve()
|
p02899 | s215067760 | Accepted | n = int(input())
alst = list(map(int, input().split()))
ans = [-1 for _ in range(n)]
for i, a in enumerate(alst, start = 1):
ans[a - 1] = i
print(*ans) |
p03408 | s057401059 | Accepted | from collections import Counter
s=Counter(input() for i in range(int(input())))
t=Counter(input() for i in range(int(input())))
print(max([0]+[s[i]-t[i] for i in s.keys()]))
|
p03548 | s755861890 | Accepted | lst = input().split()
x = int(lst[0])
y = int(lst[1])
z = int(lst[2])
x -= z
print(x // (y + z)) |
p02645 | s277657065 | Accepted | print(input()[:3]) |
p03262 | s677782755 | Wrong Answer | import math
n,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x.sort()
a=x[1]-x[0]
for i in range(1, n):
a = math.gcd(a, x[i]-x[i-1])
print(a) |
p02795 | s964471848 | Accepted | H = int(input())
W = int(input())
N = int(input())
Num = 0
Count = 0
if(H > W):
while(Num < N):
Num += H
Count += 1
else:
while(Num < N):
Num += W
Count += 1
print(Count) |
p03293 | s770928813 | Accepted | s= input()
t = input()
S = s+s
if t in S:
print('Yes')
else:
print('No')
|
p03493 | s533661899 | Accepted | s = input()
n = 0
for a in s:
if a =='1':
n += 1
print(n) |
p02756 | s461407528 | Accepted | from collections import deque
s = deque(input())
q = int(input())
rev = False
for _ in range(q):
t = input()
if t[0] == "2":
_, f, c = t.split()
if rev:
if f == "2": s.appendleft(c)
else: s.append(c)
else:
if f == "1": s.appendleft(c)
else: s.append(c)
else: rev = not rev
if rev: s.reverse()
print("".join(s))
|
p02784 | s363754735 | Accepted | h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
if sum(a) >= h:
print("Yes")
else:
print("No") |
p04011 | s626795560 | Accepted | n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n>k:
print((n-k)*y+x*k)
else:
print(x*n) |
p02989 | s309122055 | Accepted | N = int(input())
d = list(map(int, input().split()))
d.sort()
print(d[int(N/2)]-d[int(N/2-1)]) |
p02866 | s393694201 | Accepted | from collections import Counter
n = int(input())
d = list(map(int, input().split()))
mod = 998244353
c = Counter(d)
if d[0] != 0 or c[0] != 1:
print(0)
exit()
ans = 1
for i in range(1, max(d)+1):
if i not in c:
print(0)
exit()
ans *= pow(c[i-1], c[i], mod)
print(ans % mod)
|
p03456 | s471830050 | Accepted | import math
a,b = map(str,input().split())
c = (int)(a+b)
d = (int)(math.sqrt((float)(c)))
if d*d == c:
print("Yes")
else:
print("No") |
p03455 | s362527992 | Wrong Answer | a, b = map(int, input().split())
if a % b == 0:
print('Even')
else:
print('Odd') |
p02946 | s858567269 | Wrong Answer | a,b = map(int,input().split())
c = b - a + 1
d = b + a - 1
print(list(range(c,d))) |
p04029 | s850483913 | Wrong Answer | a = int(input())
print((a*(a-1))//2) |
p03136 | s934540129 | Accepted | n=int(input())
N=list(map(int,input().split()))
max_n=max(N)
N.remove(max_n)
print("Yes" if max_n<sum(N) else "No") |
p02847 | s258355135 | Accepted | s = input()
day = ['SAT','FRI','THU','WED','TUE','MON','SUN']
for i in range(7):
if s == day[i]:
print(i + 1)
exit() |
p02676 | s222675947 | Accepted | k = int(input())
s = input()
if len(s) <= k:
print(s)
else:
for i in range(k):
print(s[i],end='')
print('...')
|
p03860 | s379986330 | Accepted | AtCoder,s,Contest = map(str, input().split())
w = 'A' + str(s[0]) + 'C'
print(w) |
p02627 | s744210734 | Wrong Answer | s=input()
print(s.swapcase()) |
p03821 | s578813230 | Accepted | import math
N = int(input())
A, B = [], []
for _ in range(N):
a, b = map(int, input().split())
A.append(a)
B.append(b)
ans = 0
for a, b in zip(A[::-1], B[::-1]):
a += ans
ans += math.ceil(a / b) * b - a
print(ans) |
p03359 | s568597168 | Accepted | a, b = map(int, input().split())
if a <= b:
print(a)
else:
print(a-1) |
p03219 | s766427048 | Accepted | x,y=map(int,input().split())
print(x+y//2)
|
p03474 | s156154096 | Accepted | A, B = map(int, input().split())
S = str(input())
if S.isdecimal():
print("No")
else:
s = list(map(str, S))
del s[A]
count = s.count("-")
if count ==0:
print("Yes")
else:
print("No")
|
p03380 | s720039596 | Accepted | import math
n = int(input())
a = sorted(list(map(int,input().split())))
b = (a[-1]+1)//2
d = float("inf")
for i in a:
if abs(b-i) < d:
d = abs(b-i)
ans = i
print(a[-1],ans) |
p02946 | s590634245 | Accepted | import sys
input = lambda: sys.stdin.readline().rstrip()
def main():
k, x = map(int, input().split())
black = [i for i in range(x-(k-1), x+k)]
print(*black)
if __name__ == '__main__':
main() |
p02577 | s818466052 | Accepted | n = input()
def digitSum(n):
array = list(map(int, n))
return sum(array)
if digitSum(n)%9==0:
print("Yes")
else:
print("No") |
p02555 | s766921017 | Wrong Answer | import sys
import numpy as np
import math
s = int(input())
if s < 3:
print(0)
sys.exit()
max1 = s // 3
min1 = s // 9 + np.sign(s % 9)
answer = 0
for j in range(min1, max1+1):
keta = [3] * j
choice = j
answer1 = 1
for i in range(s-j*3):
answer1 *= choice
keta[-1] += 1
if keta[-1] == 9:
keta.pop()
choice -= 1
answer += answer1
print(answer % (10**9+7))
|
p03067 | s624083624 | Accepted | a,b,c = map(int,input().split())
if a >= c >= b or a <= c <= b:
print('Yes')
else:
print('No') |
p04005 | s475194522 | Accepted | #sortedをつけながらinput
a,b,c=sorted(map(int,input().split()))
# a,b,cに偶数があれば0
print((a*b*c)%2*a*b) |
p03211 | s207721354 | Accepted | s = [int(i) for i in list(input())]
num_li = []
for i in range(len(s)-2):
num_li.append(s[i]*100+s[i+1]*10+s[i+2])
if 753 in num_li:
print(0)
else:
print(min([abs(753-n) for n in num_li])) |
p02688 | s278916022 | Wrong Answer | N, K = map(int, input().split())
data = set(range(N + 1))
data = data - {0}
data_remove = set()
for i in range(K):
n = int(input())
data_n = set(input().split())
data_remove = data_remove | data_n
print(len(data - data_remove))
|
p02622 | s722235634 | Accepted | ans = 0
for s, t in zip(input(), input()):
if s != t : ans+=1
print(ans) |
p03208 | s191853196 | Accepted | n,k=map(int,input().split())
h=[]
for i in range(n):
h.append(int(input()))
h_sort=sorted(h)
print(min(h_sort[j+k-1]-h_sort[j] for j in range(n-k+1))) |
p04020 | s206183200 | Wrong Answer | N = int(input())
A = [int(input()) for _ in range(N)]
ans = 0
cnt = 0
for i in range(N):
ans += (A[i]+cnt)//2
cnt = A[i]%2
print(ans) |
p02842 | s465646233 | Wrong Answer | N = int(input())
for x in range(1,10000):
if x*108//100==N:
print(x)
break
if x==9999:
print(":(") |
p02714 | s524603962 | Accepted | n = int(input())
s = input()
ans = s.count('R')*s.count('G')*s.count('B')
for i in range(n-2):
for j in range(i+1,n-1):
if 2*j - i > n-1:
break
if s[i] != s[j] and s[j] != s[2*j-i] and s[2*j-i] != s[i]:
ans -=1
print(ans)
|
p02761 | s326591839 | Accepted | n,m = map(int,input().split())
ans = ["-1"]*n
for _ in range(m):
s,c = input().split()
s = int(s)-1
if ans[s] != "-1" and ans[s] != c:
print(-1)
exit()
ans[s] = c
if n != 1 and ans[0] == "0":
print(-1)
exit()
for i in range(n):
if ans[i] == "-1":
ans[i] = "0" if i != 0 or n == 1 else "1"
print("".join(ans)) |
p03720 | s032899990 | Wrong Answer | a,b=map(int,input().split())
L=[]
for i in range(b):
L.append(list(map(int,input().split())))
for i in range(b):
print(L.count(i+1))
|
p02727 | s250486064 | Accepted | x,y,a,b,c = map(int,input().split())
n = a+b+c
ar = list(map(int,input().split()))
br = list(map(int,input().split()))
cr = list(map(int,input().split()))
ls = []
for i in ar:
ls.append([i,1])
for i in br:
ls.append([i,2])
for i in cr:
ls.append([i,3])
ls.sort(reverse = True)
nx = 0
ny = 0
cnt = 0
res = 0
for item in ls:
if item[1]==1:
if nx==x: continue
nx+=1
if item[1]==2:
if ny==y: continue
ny+=1
res+=item[0]
cnt+=1
if cnt==x+y:
break
print(res) |
p02621 | s452377761 | Accepted | a = int(input())
print(a+ a**2+ a**3) |
p03286 | s307412371 | Accepted | n = int(input())
ans = abs(n)
for i in range(n > 0, 50, 2):
if ans & (1 << i) == (1 << i):
ans += (1 << (i + 1))
print(f'{ans:b}')
|
p03632 | s288800613 | Accepted | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
def main():
A, B, C, D = map(int, input().split())
print(max(min(B, D) - max(A, C), 0))
if __name__ == "__main__":
main()
|
p03624 | s404914075 | Accepted | # Vicfred
# https://atcoder.jp/contests/abc071/tasks/abc071_b
# string manipulation, implementation
S = input().strip()
alphabet = "abcdefghijklmnopqrstuvwxyz"
for ch in alphabet:
if ch not in S:
print(ch)
exit()
print("None")
|
p03067 | s429691013 | Accepted | a, b, c = map(int, input().split())
if a <= c <= b:
print('Yes')
elif b <= c <= a:
print('Yes')
else:
print('No') |
p02688 | s004077773 | Accepted | N, K = map(int, input().split())
t = [1] * N
for i in range(K):
d = int(input())
A = list(map(int, input().split()))
for a in A:
t[a-1] = 0
print(sum(t)) |
p02552 | s746832997 | Accepted | # -*- coding: utf-8 -*-
X = int(input())
if X == 1:
print('0')
else:
print('1') |
p02744 | s761962156 | Accepted | N = int(input())
ans = []
def dp(arg, level):
global N
if len(arg) == N:
ans.append(arg)
return
#
orda = ord('a')
for i in range(level):
dp(arg + chr(orda + i), level)
dp(arg + chr(orda + level), level + 1)
return
dp('', 0)
for ansi in ans:
print(ansi) |
p03338 | s736064279 | Accepted | n = int(input())
s = input()
ans = 0
for i in range(n-1):
s1 = s[:i+1]
it = iter(s[i+1:])
it2 = iter(s[i+1:])
s2 = dict(zip(it,it2))
visited = {}
for i in s1:
if i in visited:
continue
if i in s2:
visited[i] = 1
ans = max(ans,len(visited))
print(ans) |
p03524 | s882540048 | Wrong Answer | import collections as c
import sys
s = input()
l = len(s)
if l == 1:
print("NO")
else:
S = c.Counter(list(map(str,s)))
if len(S.keys()) <= 2:
if l == 2:
print("YES")
else:
print("NO")
sys.exit()
cnt = set(list(S.values()))
if len(cnt) == 3:
print("NO")
elif len(cnt) == 2:
a,b = cnt
if abs(a-b) <= 1:
print("YES")
else:
print("NO")
else:
print("YES") |
p03612 | s549598790 | Accepted | N=int(input())
P=[1]+list(map(int,input().split()))
ans=0
for i in range(1,N+1):
if P[i]==i:
if (i<N and i+1==P[i+1]) or i==1:
P[i+1],P[i]=P[i],P[i+1]
ans+=1
else:
P[i-1],P[i]=P[i],P[i-1]
ans+=1
print(ans) |
p04019 | s791880762 | Wrong Answer | s = input()
ans1 = True
ans2 = True
if "N" in s:
ans1 = "S" in s
if "W" in s:
ans2 = "E" in s
print("Yes" if ans1 and ans2 else "No") |
p02912 | s219593458 | Accepted | from heapq import heapify, heappush, heappop
n, m = [int(it) for it in input().split(' ')]
items = [ - int(it) for it in input().split(' ')]
heapify(items)
for i in range(m):
heappush(items, - (- heappop(items) // 2))
print(- sum(items))
|
p02957 | s933229408 | Wrong Answer | A,B=map(int,input().split())
if A%2==B%2: print('IMPOSSIBLE')
else: print(int((A+B)/2)) |
p02639 | s238887977 | Accepted | x = list(map(int, input().split()))
print(sum(range(1, 5 + 1)) - sum(x))
|
p02724 | s096404991 | Wrong Answer | X = int(input())
counta = 0
countb = 0
while X%500 == 0:
counta +=1
X//=500
while X%5==0:
countb +=1
X//=5
print(1000*counta+5*countb) |
p03073 | s129048425 | 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():
S = readline().strip()
count = 0
for i, c in enumerate(S):
if i % 2 == int(c):
count += 1
print(min(count, len(S) - count))
return
if __name__ == '__main__':
main()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.