problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02699 | s019451174 | Accepted | n, m = map(int, input().split())
if m >= n:
print('unsafe')
else:
print('safe') |
p03416 | s332100915 | Accepted | import math
#n, a, b= map(int, input().split())
a, b = map(int, input().split())
#h = list(map(int, input().split()))
#s = list(str(input()))
#n = int(input())
tot = 0
count = 0
for i in range(a, b+1):
n_str = list(str(i))
integ = [int(s) for s in n_str]
integ_rev = integ[::-1]
if (integ == integ_rev):
... |
p02772 | s489943074 | Accepted | import sys
n = int(input())
a_list = list(map(int, input().split()))
for a in a_list:
if a % 2 == 0:
if a % 3 != 0 and a % 5 != 0:
print('DENIED')
sys.exit(0)
print('APPROVED') |
p03001 | s171938646 | Accepted | W, H, x, y = map(int,input().split())
cg = [W/2, H/2]
if [x, y] == cg:
print( W * H / 2, 1)
else:
print(W * H / 2, 0) |
p02556 | s844032301 | Accepted | N = int(input())
xy = []
for i in range(N):
xy.append(list(map(int, input().split())))
def f(x, y):
return [x - y, x + y]
XY = []
for x, y in xy:
XY.append(f(x, y))
large, small = [-float('inf'), -float('inf')], [float('inf'), float('inf')]
for i in range(2):
for j in XY:
large[i] = max(j[i... |
p02554 | s254802725 | Wrong Answer | M = 10**9 + 7
def main():
n = int(input())
a = 1
b = 1
c = 1
for i in range(n):
a *= 10
a %= M
b *= 9
b %= M
c *= 8
c %= M
print(a - b - b + c)
if __name__ == '__main__':
main()
|
p03860 | s751414947 | Accepted | a, s, c = input().split()
print('A'+s[0]+'C') |
p03030 | s077092734 | Accepted | n = int(input())
sp = [[input().split(), i+1] for i in range(n)]
sp = sorted(sp, key=lambda x:(x[0][0], -int(x[0][1])))
for i in range(n):
print(sp[i][1]) |
p03767 | s603424370 | Accepted | N = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
maxScoreArray = []
for i in range(N):
maxScoreArray.append(a[i*2+1])
print(sum(maxScoreArray)) |
p03803 | s400682517 | Accepted | A = [i for i in range(2, 14)] + [1]
a, b = map(int, input().split())
c = -1
d = -1
for i in range(len(A)):
if c == -1 and A[i] == a:
c = i
if d == -1 and A[i] == b:
d = i
if c > d:
print("Alice")
elif c < d:
print("Bob")
else:
print("Draw") |
p03000 | s248132178 | Accepted | n,x=map(int,input().split())
l=list(map(int,input().split()))
D=0
y=1
if x==0:
print(1)
else:
for i in range(n):
D+=l[i]
if D<=x:
y+=1
print(y) |
p03359 | s676743962 | Accepted | a, b = map(int, input().split())
if a > b:
r = a - 1
else:
r = a
print(int(r)) |
p02775 | s787083692 | Accepted | N = list(map(int, input()))
m = 0 # 最小の枚数
m_ = 1 # 繰り上がり時の枚数
for n in N:
m, m_ = min(m+n, m_ + 10-n), min(m+n + 1, m_ + 10-(n+1))
print(m) |
p02627 | s699398238 | Accepted | s = input()
if s.isupper():
print('A')
else:
print('a') |
p03145 | s271423788 | Wrong Answer | a,b,c=map(int, input().split())
print(a*b/2) |
p03136 | s419602830 | Accepted | def main():
N = int(input())
l = [int(x) for x in input().split()]
l.sort()
total = 0
for i in range(N-1):
total = total + l[i]
if total > l[N-1]:
print('Yes')
else:
print('No')
main() |
p03623 | s474441109 | Wrong Answer | x,a,b = map(int,input().split())
print("A" if abs(x-a)>abs(x-b) else "B") |
p02897 | s682148244 | Accepted | n = int(input())
print((n+1)//2/n) |
p02829 | s319960291 | Accepted | A=int(input())
B=int(input())
ans=[1,2,3]
for a in ans:
if a!=A and a!=B:
print(a) |
p03817 | s980462656 | Accepted | x = int(input())
ans = (x//11)*2
p = x % 11
if p == 0:
print(ans)
elif 1 <= p <= 6:
print(ans+1)
elif 7<= p:
print(ans+2)
|
p02615 | s151758329 | Accepted | import sys
#import time
#from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
#import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().stri... |
p02697 | s262996464 | Accepted | n, m = list(map(int, input().split()))
a = 1
b = n
if n%2==1:
for i in range(m):
print(a, b)
a += 1
b -= 1
else:
pair = 0
while b-a > n//2 and pair < m:
print(a, b)
pair += 1
a += 1
b -= 1
a += 1
while pair < m:
print(a, b)
pa... |
p02957 | s685229220 | Accepted | #create date: 2020-07-05 10:44
import sys
stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))
def main():
a, b = na()
if a > b:
a, b = b, a
if (b - a) % 2 != 0:
print("IMPOSSIBLE")
quit()... |
p03545 | s544377142 | Accepted | s = input()
n = len(s)
for i in range(2**(n-1)):
op = ["-"] * (n-1)
for j in range(n-1):
if (i >> j) & 1:
op[n - 2 -j] = "+"
#print(op)
chk = ""
for p_n, p_o in zip(s, op + [""]):
chk += (p_n + p_o)
if eval(chk) == 7:
print(chk + "=7")
exit() |
p03817 | s118403856 | Accepted | x = int(input())
div, mod = divmod(x, 11)
div *= 2
if mod > 0 and mod < 7:
div += 1
elif mod > 6:
div += 2
print(div) |
p02996 | s478823761 | Wrong Answer | # AtCoder
N = int(input())
l = [list(map(int, input().split())) for i in range(N)]
m = sorted(l, key=lambda x: x[0])
work = 0
mx = -100
for i in range(N):
work += m[i][0]
mx = max(m[i][1], mx)
if mx >= work:
print('Yes')
else:
print('No')
|
p03319 | s389974002 | Wrong Answer | n,k=map(int,input().split())
l=list(map(int,input().split()))
i=l.index(1)
k-=1
print(-(-i//k)-((-(n-i-1))//k))
|
p02732 | s755572451 | Accepted | import collections
n = int(input())
a = list(map(int, input().split()))
c = dict(collections.Counter(a))
sum = 0
for v in c.values():
sum += (v * (v - 1)) // 2
for i in a:
temp = c[i] - 1
ans = (temp * (temp - 1)) // 2
ans += sum
ans -= (c[i] * (c[i] - 1)) // 2
print(ans) |
p02793 | s529943415 | Wrong Answer | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
import math
from functools import reduce
n = int(readline())
a = list(map(int,readline().split()))
def lcm(x, y):
return (x * y) // math.gcd(x, y)
x = reduce(lcm, a, 1)
ans = 0
for i in a:
ans += x //... |
p02681 | s307055071 | Wrong Answer | S = input()
T = input()
Slis = list(S)
Tlis = list(T)
Tlis.remove(Tlis[ - 1])
if len(S) == 0:
print('No')
elif Slis == Tlis:
print('Yes')
else:
print('No') |
p03472 | s213476154 | Accepted | import math
n,h = map(int, input().split())
al = []
bl = []
for _ in range(n):
a,b = map(int, input().split())
al.append((a,'swing'))
bl.append((b,'throw'))
abl = al + bl
abl.sort(reverse=True)
remain_h = h
ans = 0
for v in abl:
damage, command = v
if command == 'swing':
ans += math.ceil(... |
p03487 | s484718707 | Accepted | from collections import Counter
N = int(input())
a = list(map(int,input().split()))
a = Counter(a)
ans = 0
for i in a:
if i <= a[i]:
ans+=a[i]-i
else:
ans+=a[i]
print(ans) |
p03407 | s007873151 | Accepted | a,b,c = map(int,input().split())
print('Yes' if (a+b)>=c else 'No') |
p03319 | s649908197 | Accepted | from math import ceil
n,k = map(int,input().split())
a = list(map(int,input().split()))
print(ceil((n - 1) / (k - 1)))
|
p03126 | s035463929 | Accepted | n,m = map(int,input().split())
ka = [list(map(int,input().split())) for i in range(n)]
cnt = [0]*(m+1)
for i in range(n):
for j in range(1,ka[i][0]+1):
cnt[ka[i][j]] += 1
print(cnt.count(n)) |
p02726 | s147785756 | Accepted | n,x,y=map(int,input().split())
x-=1;y-=1
fl=[0 for i in range(n-1)]
for i in range(n):
for j in range(i+1,n):
fl[min(abs(j-i),abs(j-x)+1+abs(y-i),abs(i-x)+1+abs(y-j))]+=1
print(*fl[1:],sep="\n")
print(0)
|
p03252 | s762715922 | Accepted | # -*- coding: utf-8 -*-
#110_c
S = input()
T = input()
combination = []
for i, j in zip(S,T):
combination.append([i,j])
set_S = []
set_T = []
for i,j in list(map(list, set(map(tuple, combination)))):
set_S.append(i)
set_T.append(j)
if len(set_S) == len(set(set_S))and len(set_T) == len(set(set_T)):
... |
p02725 | s002906762 | Accepted | K, N = map(int, input().split())
A = list(map(int, input().split()))
dis = [(K+A[0]-A[-1])]
for i in range(len(A)):
if i+1 == len(A):
break
dis.append(A[i+1] - A[i])
print(K - max(dis)) |
p02963 | s469582883 | Accepted | import math
s = int(input())
x1 = 1000000000
y1 = 1
y2 = math.ceil(s / x1)
x2 = y2 * x1 - s
print(0, 0, x1, y1, x2, y2) |
p02708 | s113575349 | Wrong Answer | N, K = map(int, input().split())
ans = 0
for k in range(K, N+1):
mi = k*(k-1)//2
ma = k*(2*N-k+1)//2
ans += ma - mi + 1
ans %= 1000000007
print(ans)
|
p02657 | s656826839 | Wrong Answer | import math
a, b = map(str, input().split())
a = int(a)
b = float(b)
print(a, b, a * b)
b = int(b * 1000)
print(a, b, a * b, a * b // 1000)
ans = int(a * b // 1000)
print(ans) |
p02719 | s528965485 | Accepted | n,k = map(int, input().split())
r = n % k
s = abs(r - k)
print(min(r,s))
|
p03087 | s036586957 | Accepted | N, Q = map(int, input().split())
S = input()
t = [0] * (N+1)
for i in range(N):
t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)
for i in range(Q):
l,r = map(int, input().split())
print(t[r-1] - t[l-1])
|
p03011 | s409570137 | Wrong Answer | A = [int(i) for i in input().split()]
ans = 100
for i in range(3):
for j in range(i + 1, 3):
ans = min(ans, A[i] + A[j])
print(ans)
|
p02678 | s639478853 | Accepted | from collections import deque
n, m = map(int, input().split())
route = [[] for i in range(n)]
for i in range(m):
a, b = map(int, input().split())
route[a-1].append(b - 1)
route[b-1].append(a - 1)
next_queue = deque()
sign = [-1] * n
sign[0] = 999
next_queue.append(0)
while next_queue:
current_number... |
p03592 | s685518230 | Accepted | N,M,K = map(int,input().split())
ans = 'No'
for x in range(M+1):
if M-2*x == 0:
if K%N == 0:
ans = 'Yes'
break
else:
continue
else:
if (K-N*x)%(M-2*x) == 0 and 0 <= (K-N*x)/(M-2*x) <= N:
ans = 'Yes'
break
else:
... |
p03814 | s087279031 | Accepted | s= input()
number = s.rfind("Z") - s.find("A")
print(number+1) |
p03485 | s314307955 | Accepted | import math
print(math.ceil(sum(map(int,input().split())) / 2)) |
p02690 | s667862312 | Accepted | X = int(input())
a = []
for i in range(4000):
a.append(i**5)
for i in range(4000):
if X + a[i] in a:
A = int((X + a[i])**0.2)
B = i
elif X - a[i] in a:
A = int((X - a[i])**0.2)
B = -i
print(A,B) |
p03289 | s039784258 | Accepted | s = input()
ans = 'WA'
if s[0] == 'A' and s[2:-1].count('C') == 1\
and s.replace('A', '').replace('C', '').islower():
ans = 'AC'
print(ans)
|
p02690 | s169535877 | Accepted | X=int(input())
for i in range(-1000,1000):
for j in range(-1000,1000):
if i**5==j**5+X:
A=i
B=j
break
print(A,B) |
p03105 | s477571757 | Accepted | a, b, c = map(int, input().split())
if b // a < c:
print(b//a)
else:
print(c) |
p02578 | s653220326 | Accepted | n = int(input())
a = [int(i) for i in input().split()]
h = 0
c = 0
for ai in a:
if ai < h:
c += h - ai
h = max(ai, h)
print(c) |
p02933 | s280441556 | Accepted | a=int(input())
if a >= 3200:
print(input())
else:
print('red') |
p03827 | s762478856 | Wrong Answer | #a,b,c,d=map(int,input().split())
n=int(input())
s=input()
ans=0
for i in s:
if i=="I":
ans+=1
elif i=="D":
ans-=1
if ans<0:
print(0)
else:
print(ans)
|
p02729 | s051217343 | Wrong Answer | N,M = map(int,input().split())
# ue,sita,uee,sitaa = 0,0,0,0
# tmpN,tmpM = 0,0
# if N != 2:
# for i in range(N+1):
# ue *= N-i
# sita *= N-2-i
# tmpN = ue/sita
# if M != 2:
# for i in range(M+1):
# uee *= N-i
# sitaa *= N-2-i
# tmpM = uee/sitaa
# print(tmpN+tmpM)
ans = ... |
p02584 | s970813938 | Wrong Answer | x,k,d=map(int,input().split())
if (x-(k*d))>0:
print((x-(k*d)))
elif (x-(k*d))==0:
print(0)
elif x==k and k==d:
print(abs(x-0))
else:
k1=0
a=(x-(k1*d))
while a>0:
k1+=1
a=(x-(k1*d))
print(abs(a-0)) |
p02772 | s807080875 | Accepted |
N = int(input())
*A, = map(int, input().split())
for a in A:
if a % 2 == 0:
if a % 3 == 0 or a % 5 == 0:
pass
else:
print("DENIED")
exit()
print("APPROVED") |
p02972 | s054446559 | Accepted | n=int(input())
a=list(map(int,input().split()))
ans=[0]*(n+1)
for i in range(n,0,-1):
temp=0
for j in range(i,n+1,i): temp+=ans[j]
if a[i-1]!=temp%2: ans[i]=1
print(sum(ans))
for i in range(n+1):
if ans[i]==1: print(i,end=" ") |
p03069 | s202504861 | Accepted | #!/usr/bin/env python
# coding: utf-8
# In[6]:
N = int(input())
S = input()
# In[9]:
w = S.count(".")
b = 0
ans = min(w,N-w)
for i in range(N):
if S[i] == ".":
w -= 1
else:
b += 1
ans = min(ans, w+b)
print(ans)
# In[ ]:
|
p03860 | s174454850 | Accepted | a, s, c = input().split()
print(a[0]+s[0]+c[0])
|
p02665 | s552857284 | Accepted | n = int(input())
a = list(map(int, input().split()))
sa = sum(a)
b = [1]
f = True
for i in range(n+1):
sa -= a[i]
d = min(sa, (b[i] - a[i]) * 2)
if d < 0:
f = False
break
b.append(d)
print(sum(b) if f else -1)
|
p03962 | s936949662 | Accepted | c = input().split()
print(len(list(set(c)))) |
p02723 | s728092807 | Wrong Answer | s=input();print('NYOE S'[s[2]==s[3]and s[4]==s[5]::2]) |
p02951 | s312962579 | Accepted | A, B, C = map(int, input().split())
print(max((C - (A - B)), 0)) |
p02847 | s802432225 | Accepted | # A - Can't Wait for Holiday
# 文字列 S の入力
S = input()
# print(S)
# 何日後か求める条件文
if S == 'SUN':
print(7)
elif S == 'MON':
print(6)
elif S == 'TUE':
print(5)
elif S == 'WED':
print(4)
elif S == 'THU':
print(3)
elif S == 'FRI':
print(2)
elif S == 'SAT':
print(1)
|
p03481 | s564242070 | Wrong Answer | import math
x,y = map(int,input().split())
print(int(math.log2(y/x))+1) |
p03317 | s826653825 | Accepted | n,k,*_=map(int,open(0).read().split())
print(0--~-n//~-k) |
p02797 | s148143147 | Wrong Answer | import numpy as np
N, K, S = map(int, input().split())
X = [S for _ in range(K)]
Y = [S + 100 for _ in range(N - K)]
print(' '.join(map(str, X+Y)))
|
p04031 | s825752150 | Wrong Answer | from statistics import mean
import math
n=int(input())
arr=[int(x) for x in input().split()]
a=math.ceil(mean(arr))
s=0
for x in arr:
s=s+((x-a)**2)
print(s) |
p03719 | s184705259 | Wrong Answer | A,B,C = map(int,input().split())
if C<=A and C>=B:
print('Yes')
else:
print('No') |
p02973 | s309692870 | Wrong Answer | import bisect
N = int(input())
seq = [-int(input()) for i in range(N)]
LIS = [seq[0]]
for i in range(1,len(seq)):
if seq[i] >= LIS[-1]:
LIS.append(seq[i])
else:
LIS[bisect.bisect_left(LIS, seq[i])] = seq[i]
print(len(LIS)) |
p03672 | s378719632 | Accepted | s = list(input())
s = s[:-1]
while s[:len(s)//2] != s[len(s)//2 :]:
s = s[:-1]
# print(s)
print(len(s)) |
p02554 | s141639930 | Accepted | M = 10 ** 9 + 7
n = int(input())
if n <= 1:
print(0)
exit()
nones = 8
zero = 1
nine = 1
other = 0
for x in range(1, n):
other = other * 10 + zero + nine
zero = zero * 9 + nones
nine = nine * 9 + nones
nones *= 8
other %= M
zero %= M
nine %= M
nones %= M
print(other) |
p02718 | s384879763 | Wrong Answer | n, m = map(int, input().split())
a = list(map(int, input().split()))
u = sum(a) / (4*m)
l = 0
for i in a:
if i > u:
l += 1
print("Yes") if l >= m else print("No") |
p03243 | s073282086 | Wrong Answer | # coding: utf-8
# Your code here!
N=list(input())
if len(set(N))==1:
print(''.join(N))
else:
if int(N[0])<int(N[1]) or int(N[1])<int(N[2]) or int(N[0])<int(N[2]):
N=[int(N[0])+1]*len(N)
else:
N=[int(N[0])]*len(N)
print(''.join(map(str,N))) |
p03565 | s439582091 | Accepted | Sp = input()
T = input()
S = []
for i in range(len(Sp)-len(T)+1):
for j in range(len(T)):
if Sp[i+j] not in ("?",T[j]):
break
else:
tmp = Sp[:i] + T + Sp[i+len(T):]
S.append(tmp.replace("?","a"))
print(min(S) if S else "UNRESTORABLE")
|
p03136 | s629322190 | Accepted | n = int(input())
l = list(map(int,input().split()))
if sum(l) > 2*max(l):
print("Yes")
else:
print("No")
|
p02684 | s852726934 | Accepted | import sys
from collections import deque
input = sys.stdin.readline
N, K = map(int, input().split())
A = list(map(int, input().split()))
visited = set()
q = deque()
q.append(1)
root = []
while q:
pos = q.pop()
if pos in visited:
start = root.index(pos)
s_len = len(root[:start])
l_len ... |
p03261 | s375382203 | Accepted | n = int(input())
W = []
for _ in range(n):
w = input()
if w in W:
print('No')
exit()
W.append(w)
for i in range(n-1):
if W[i][-1] != W[i+1][0]:
print('No')
exit()
print('Yes') |
p03281 | s705208899 | Accepted | n=int(input())
ans=0
for i in range(1,n+1,2):
ct=0
for j in range(1,i+1):
if i%j==0: ct+=1
if ct==8: ans+=1
print(ans)
|
p03543 | s569086606 | Accepted | a = list(input())
j = 0
for i in range(2):
if len(set(a[i:i+3])) == 1:
j = 1
if j == 1:
print("Yes")
else:
print("No") |
p02843 | s930318881 | Wrong Answer | N = int(input())
x = N//100
y = N%100
if x == 0:
print(1)
exit()
if y/x > 5:
print(0)
else:
print(1) |
p03131 | s605826311 | Accepted | K,A,B = list(map(int,input().split()))
if K+1 <= A:
print(K+1)
else:
if 2 <= B-A:
K -= A-1
ans = A + K//2 * (B-A)
if K%2 == 1:
ans += 1
else:
ans = K+1
print(ans) |
p03327 | s989739488 | Accepted | N = int(input())
print("ABC" if N <1000 else "ABD") |
p02570 | s225509324 | Wrong Answer | D,T,S = map(int,input().split())
result = D / S
if T > result:
print('Yes')
else:
print('No') |
p02629 | s531017489 | Wrong Answer | def num2alpha(num):
if num<=26:
return chr(64+num)
elif num%26==0:
return num2alpha(num//26-1)+chr(90)
else:
return num2alpha(num//26)+chr(64+num%26)
n = int(input())
ans = num2alpha(n)
print(ans) |
p02572 | s192634868 | Accepted | mod = int(1e9 + 7)
def pw(b, ex):
if ex == 0: return 1
if ex == 1: return b
if ex & 1: return b % mod * pw((b*b) % mod, ex >> 1) % mod
return pw((b*b) % mod, ex >> 1) % mod
n = int(input())
x = list(map(int,input().split()))
st = 0
en = 0
for i in x:
st = (st + i) % mod
en = (en + (i * i) % m... |
p03796 | s968630219 | Wrong Answer | n = int(input())
mod = 7 + 10**8
ans = 1
for i in range(1,n+1):
ans = (ans%mod) * (i%mod) % mod
print(ans) |
p02793 | s866505081 | Wrong Answer | import fractions
N = int(input())
A = list(map(int, input().split()))
def lcm(x, y):
return (x * y) // fractions.gcd(x, y)
def solve():
memo = 0
for i in range(N - 1):
if i == 0:
memo = lcm(A[i], A[i + 1])
memo = lcm(memo, A[i + 1])
ans = 0
for i in range(N):
... |
p02552 | s691168258 | Wrong Answer | n = input()
if n: print(0)
else: print(1) |
p03437 | s087671480 | Wrong Answer | x, y = map(int, input().split())
if y % x == 0:
print(-1)
else:
print(x)
|
p03448 | s954420974 | Wrong Answer | A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans =0
for i in range(A):
for j in range(B):
for k in range(C):
tmp = 500*i + 100*j +50*k
if X == tmp:
ans +=1
print(ans)
|
p02912 | s395077017 | Wrong Answer | from collections import deque
N, M = map(int, input().split())
A = list(map(int, input().split()))
d = deque(sorted(A)[::-1])
d_2 = deque([])
a = d.popleft()
d_2.append(a // 2)
M -= 1
while M > 0:
if len(d) > 0 and d[0] > d_2[-1]:
a = d.popleft()
d_2.appendleft(a // 2)
else:
d_2[-1] /... |
p02724 | s037821430 | Accepted | import sys
x = int(sys.stdin.readline())
a = x //500
b = (x%500)//5
print(1000*a + 5*b) |
p02659 | s185501756 | Accepted | from math import floor
inp = input()
a, b = inp.split()
b += '00000001'
a = int(a)
b = float(b)
b100 = int(b * 100)
ans100 = a * b100
ans = ans100 // 100
print(ans)
|
p02952 | s634969437 | Wrong Answer | import sys
input = sys.stdin.readline
N = int(input())
ans = 0
while(True) :
if N <= 9 :
ans += N
break
else :
ans += 9
if N >= 100 :
if N < 1000 :
ans += N - 100 + 1
break
else :
ans += 900
else :
break
if N >= 1000... |
p03150 | s609237418 | Wrong Answer | S = input()
target = "keyence"
length = len(target)+1
if target in S:
print("YES")
exit()
else:
for i in range(1, length):
first = target[:i]
second = target[i:]
if first in S and second in S and S.find(first) <= S.rfind(second):
print("YES")
exit()
print("NO")
|
p02661 | s000024775 | Wrong Answer | from sys import stdin
from decimal import Decimal
N = int(stdin.readline().rstrip())
A = []
B = []
for i in range(N):
a,b = [int(x) for x in stdin.readline().rstrip().split()]
A.append(a)
B.append(b)
A.sort()
B.sort()
if N % 2 == 0:
ans = Decimal(sum(B))/Decimal(2) - Decimal(sum(A))/Decimal(2)
... |
p02996 | s306220937 | Wrong Answer | N=int(input())
A=[tuple(map(int,input().split())) for i in range(N)]
A.sort(key=lambda x: x[1])
a=0
b=0
c=0
for i in range(len(A)):
a+=A[i][0]
b+=A[i][1]
if a>b:
c+=1
print('No')
break
if c==0:
print('Yes') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.