s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s111096304 | p03951 | u680035567 | 1477792735 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 223 | N = input()
s = input()
t = input()
temp = 0
flag = True
while(temp < N-1 & flag):
temps = s[N-temp-1:N-1]
tempt = t[:temp]
if(temps==tempt):
temp += 1
else:
flag = False
print(N+N-temp) |
s423648553 | p03951 | u582243208 | 1477791730 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 260 | n=int(input())
s=input()
t=input()
if s==t:
print(n)
else:
ans=2*n
f=True
for i in range(n):
for j in range(i+1):
if t[j]==a[n-1-i+j]:
f=False
if not f:
break
ans-=1
print(ans) |
s256875576 | p03951 | u582243208 | 1477791655 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 254 | n=int(input())
s=input()
t=input()
if s==t:
print(n)
else:
ans=2*n
f=True
for i in range(n):
for j range(i+1):
if t[j]==a[n-1-i+j]:
f=False
if !f:
break
ans-=1
print(ans) |
s456266932 | p03951 | u582243208 | 1477791620 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 257 | n=int(input())
s=input()
t=input()
if s==t:
print(n)
else:
ans=2*n
f=True
for i in range(n):
for j range(i+1):
if t[j]==a[n-1-i+j]:
f=False
if not f:
break
ans-=1
print(ans) |
s047859888 | p03951 | u582243208 | 1477791540 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 242 | n=int(input())
s=input()
t=input()
if s==t:
print(n)
else:
ans=2*n
f=True
for i in range(n):
for j range(i+1):
if t[j]==a[n-1-i+j]:
f=False
if not f:
break
print(ans) |
s699702843 | p03951 | u591287669 | 1477791390 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 135 | n=int(input())
s=input()
t=input()
for i in range(n):
if s[i:] == t[:n-i]:
print(n+i)
exit(1)
else:
print(n*2)
|
s352254448 | p03951 | u820351940 | 1477791148 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 105 | N, K = map(int, input().split())
print("No" if K < N else "Yes\n" + "\n".join(map(str, range(1, K * 2)))) |
s816929129 | p03951 | u687206691 | 1477790336 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 116 | n, x = map(int, raw_input().split())
if x == n:
print 'Yes'
for i in range(1, 2 * n):
print i
else:
print 'No' |
s348240247 | p03951 | u687206691 | 1477790269 | Python | Python (2.7.6) | py | Runtime Error | 15 | 2568 | 118 | n, x = map(int, raw_input().split())
if x == n:
print 'Yes':
for i in xrange(1, 2 * n):
print i
else:
print 'No' |
s533497889 | p03951 | u687206691 | 1477790180 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 117 | n, x = map(int, raw_input().split())
if x == n:
print 'Yes':
for i in range(1, 2 * n):
print i
else:
print 'No' |
s314834085 | p03951 | u140672616 | 1477790070 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 140 | import sys
N = int(input())
a = input()
b = input()
for i in range(N):
if(a[0:N-i] == b[i:N]){
print(N+i)
sys.exit()
print(2 * N) |
s245142212 | p03951 | u393971002 | 1477790016 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 171 | N = int(input())
s = input()
t = input()
for i in range(1, N):
if s[i:] == t[:-i]:
k = N - i
break
if s == t:
print(N)
else:
print(2 * N - k) |
s935400879 | p03951 | u478015420 | 1477789415 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 192 | import sys; sys.stdin = open('input.txt')
n = int(raw_input())
a = raw_input()
b = raw_input()
res = n
for i in xrange(n):
if a.endswith(b[:n-i]):
break
res += 1
print res |
s175911929 | p03952 | u113971909 | 1598287944 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8952 | 312 | n, x = map(int, input().split())
if abs(n-x)<=1 :
print('Yes')
else:
print('No')
exit()
if n == x:
for i in range(2*(n-1)):
print(i+1)
elif x == n-1:
print(n)
for i in range(2*(n-1)):
if i != n:
print(i)
else x == n-1:
for i in range(2*(n-1)):
if i != n:
print(i)
print(n) |
s658375956 | p03952 | u651663683 | 1597012351 | Python | Python (3.8.2) | py | Runtime Error | 114 | 18412 | 424 | n,x=list(map(int,input().split()))
if x==1 or x==2*n-1:
print("No")
elif x==2*n-2:
print("Yes")
for i in range(n-1):
print(i+1)
print(x)
print(2*n-1)
for i in range(n-1,x-1):
print(i+1)
else:
print("Yes")
l=[i for i in range(1,x-1)]+[i for i in range(x,2*n-3)]
for i in range(n-1):
print(l[... |
s521288377 | p03952 | u654470292 | 1594879045 | Python | PyPy3 (7.3.0) | py | Runtime Error | 155 | 82044 | 1440 | import bisect
import copy
import heapq
import statistics
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
return sys.stdin.readline()[:-1]
def ruiseki(lst):
return [0]+list(accumulate(lst))
sys.set... |
s565277900 | p03952 | u654470292 | 1594878981 | Python | PyPy3 (7.3.0) | py | Runtime Error | 148 | 82028 | 1325 | import bisect
import copy
import heapq
import statistics
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
return sys.stdin.readline()[:-1]
def ruiseki(lst):
return [0]+list(accumulate(lst))
sys.set... |
s432397122 | p03952 | u488401358 | 1592547371 | Python | PyPy3 (7.3.0) | py | Runtime Error | 84 | 74796 | 850 | N=int(input())
a=list(map(int,input().split()))
def cond(n):
L=(0,-1)
for i in range(1,N):
if a[i]>=n and a[i-1]>=n:
L=(i,1)
elif a[i]<n and a[i-1]<n:
L=(i,0)
R=(2*N-1,-1)
for i in range(2*N-3,N-2,-1):
if a[i]>=n and a[i+1]>=n:
R=(i,1)
... |
s412410673 | p03952 | u980205854 | 1591466246 | Python | Python (3.4.3) | py | Runtime Error | 224 | 12888 | 539 | # B - Median Pyramid Easy
from collections import deque
N,x = map(int,input().split())
if x==1 or x==2*N-1:
print('No')
elif N==2:
print('Yes')
for x in range(1,4):
print(x)
else:
print('Yes')
if x==2:
num = deque(list(range(5,2*N)))
que = deque([3,2,1,4])
else:
n... |
s022918947 | p03952 | u980205854 | 1591465922 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 11252 | 527 | # B - Median Pyramid Easy
N,x = map(int,input().split())
if x==1 or x==2*N-1:
print('No')
elif N==2:
print('Yes')
for x in range(1,4):
print(x)
else:
print('Yes')
if x==2:
num = num[4:]
que = [3,2,1,4]
else:
num = list(range(1,2*N))
que = []
for _ ... |
s046195608 | p03952 | u980205854 | 1591465748 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 12916 | 520 | # B - Median Pyramid Easy
N,x = map(int,input().split())
if x==1 or x==2*N-1:
print('No')
elif N==2:
print('Yes')
for x in num:
print(x)
else:
print('Yes')
if x==2:
num = num[4:]
que = [3,2,1,4]
else:
num = list(range(1,2*N))
que = []
for _ in rang... |
s839549539 | p03952 | u980205854 | 1591464685 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 131 | # B - Median Pyramid Easy
N,x = map(int,input().split())
if N==x:
for i in range(i,N+1):
print(i)
else:
print('No') |
s724006930 | p03952 | u703950586 | 1590934518 | Python | PyPy3 (2.4.0) | py | Runtime Error | 264 | 52272 | 705 | import sys,queue,math,copy,itertools,bisect,collections,heapq
def main():
sys.setrecursionlimit(10**7)
INF = 10**18
MOD = 10**9 + 7
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
SI = lambda : sys.stdin.readline().rstrip()
N,x = LI()
... |
s217242558 | p03952 | u922449550 | 1590032121 | Python | Python (3.4.3) | py | Runtime Error | 174 | 23856 | 627 | N, x = map(int, input().split())
if x in [1, 2*N-1]:
print('No')
else:
print('Yes')
if N == 2:
print(*range(1, 4), sep='\n')
else:
ans = [0] * (2*N - 1)
s = set(range(1, 2*N))
if x >= N:
ans[N-1] = x - 1; s.discard(x-1)
ans[N] = x; s.discard(x)
ans[N+1] = x + 1; s.discard(x+1)... |
s748290638 | p03952 | u691896522 | 1588981806 | Python | Python (3.4.3) | py | Runtime Error | 266 | 14096 | 959 | n,x = map(int, input().split())
if 1 < x < (2*n - 1):
print("Yes")
if x != 2:
ans = [-1 for i in range(2*n-1)]
k = (n*2-1) //2
ans[k-1] = x-1
ans[k] = x
ans[k+1] = x+1
ans[k+2] = x-2
used = set([x-1,x,x+1,x-2])
insert = iter([i+1 for i in range(n*2... |
s958694417 | p03952 | u691896522 | 1588981745 | Python | PyPy3 (2.4.0) | py | Runtime Error | 333 | 56652 | 959 | n,x = map(int, input().split())
if 1 < x < (2*n - 1):
print("Yes")
if x != 2:
ans = [-1 for i in range(2*n-1)]
k = (n*2-1) //2
ans[k-1] = x-1
ans[k] = x
ans[k+1] = x+1
ans[k+2] = x-2
used = set([x-1,x,x+1,x-2])
insert = iter([i+1 for i in range(n*2... |
s616087133 | p03952 | u691896522 | 1588981697 | Python | PyPy3 (2.4.0) | py | Runtime Error | 306 | 56908 | 959 | n,x = map(int, input().split())
if 1 < x < (2*n - 1):
print("Yes")
if x != 2:
ans = [-1 for i in range(2*n-1)]
k = (n*2-1) //2
ans[k-1] = x-1
ans[k] = x
ans[k+1] = x+1
ans[k+2] = x-2
used = set([x-1,x,x+1,x-2])
insert = iter([i+1 for i in range(n*2... |
s844859260 | p03952 | u691896522 | 1588981208 | Python | PyPy3 (2.4.0) | py | Runtime Error | 280 | 46556 | 570 | n,x = map(int, input().split())
if 1 < x < (2*n - 1):
print("Yes")
if n == 2:
ans = [-1 for i in range(2*n-1)]
k = n//2
ans[k-1] = x-1
ans[k] = x
ans[k+1] = x+1
ans[k+2] = x-2
used = set([x-1,x,x+1,x-2])
insert = iter([i+1 for i in range(n*2-1) if ... |
s681234931 | p03952 | u145600939 | 1587758608 | Python | PyPy3 (2.4.0) | py | Runtime Error | 235 | 85128 | 556 | n,x = map(int,input().split())
if n == 2:
if x == 2:
print('Yes')
print('\n'.join([1,2,3]))
else:
print('No')
else:
if x == 1 or x == 2*n - 1:
print('No')
else:
print('Yes')
if x == 2:
ans = list(range(3,2*n-2))
ans = ans[:n-3] + [... |
s123067427 | p03952 | u397384480 | 1586900649 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 43920 | 985 | N,x = map(int,(input().split()))
if N == 2:
if x == 2:
print("Yes")
for i in range(1,4):
print(i)
else:
print("No")
else:
M = 2*N-1
if x == 1 or x ==M:
print("No")
else:
print("Yes")
ans = [0]*(M)
num = list(range(1,M+1))
i... |
s933423960 | p03952 | u693716675 | 1584232148 | Python | Python (3.4.3) | py | Runtime Error | 160 | 12532 | 416 | n,x = [int(i) for i in input().split()]
a = [i for i in range(1,2*n)]
def swap(a,i,j):
b = a[i]
a[i] = a[j]
a[j] = b
if x==1 or x==2*n -1:
print("No")
else:
print("Yes")
if x==n:
pass
elif x>n:
swap(a,n-1,x-1)
swap(a,x,2*n-2)
swap(a,x+1,0)
else:
... |
s511492700 | p03952 | u779455925 | 1583950264 | Python | Python (3.4.3) | py | Runtime Error | 141 | 41988 | 793 | N,x=map(int,input().split())
lst=[0 for i in range(2*N-1)]
if x==1 or x==2*N-1:
print("No")
else:
nlst=set([i for i in range(1,2*N)])
if x>=N:
lst[N-1]=x
lst[N]=x+1
lst[N+1]=x-1
lst[N-2]=x-2
nlst.remove(x)
nlst.remove(x+1)
nlst.remove(x-1)
nls... |
s845283791 | p03952 | u144913062 | 1583616385 | Python | PyPy3 (2.4.0) | py | Runtime Error | 298 | 51744 | 383 | N, x = map(int, input().split())
if x == 1 or x == 2*N-1:
print('No')
exit()
print('Yes')
ans = None
if x+2 <= 2*N-1:
ans = list(range(1, x-1)) + list(range(x+3, 2*N))
ans = ans[:N-3] + [x+2, x-1, x, x+1] + ans[N-3:]
elif x-2 >= 1:
ans = list(range(1, x-2)) + list(range(x+2, 2*N))
ans = ans[:N-3... |
s554571819 | p03952 | u390181802 | 1582218193 | Python | Python (3.4.3) | py | Runtime Error | 111 | 24980 | 247 | n, x = map(int, input().split())
l = 2 * n - 1
if x == 1 or x == l:
print('No')
exit(0)
ans = list(map(lambda k: (k - n + x) % l + 1, range(l)))
ans[n - 3], ans[n + 1] = ans[n + 1], ans[n - 3]
print('Yes')
print(' '.join(map(str, ans)))
|
s886835622 | p03952 | u814986259 | 1580789464 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 184 | N, x = map(int, input().split())
if N == 2:
if x != N:
print("No")
else:
exit(1)
else:
if abs(N - x) > N - 2:
print("No")
else:
exit(1) |
s604249043 | p03952 | u814986259 | 1580788607 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 181 | N, x = map(int, input().split())
if N <= 3:
if x != N:
print("No")
else:
exit(1)
else:
if abs(N - x) > 1:
print("No")
else:
exit(1)
|
s741618526 | p03952 | u814986259 | 1580788551 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 185 | N, x = map(int, input().split())
if N <= 3:
if x != N:
print("No")
else:
exit(1)
else:
if abs(N - x) > N - 3:
print("No")
else:
exit(1)
|
s931622275 | p03952 | u638795007 | 1577561937 | Python | Python (3.4.3) | py | Runtime Error | 213 | 29144 | 1465 | def examA():
N = I()
S = SI(); T = SI()
ans = 2*N
for l in range(N-1,-1,-1):
flag = True
for i in range(l+1):
if S[N-1-i] != T[l-i]:
flag = False
break
if flag:
ans -=(l+1)
break
print(ans)
return
def ex... |
s400312462 | p03952 | u638795007 | 1577560815 | Python | Python (3.4.3) | py | Runtime Error | 206 | 30376 | 1464 | def examA():
N = I()
S = SI(); T = SI()
ans = 2*N
for l in range(N-1,-1,-1):
flag = True
for i in range(l+1):
if S[N-1-i] != T[l-i]:
flag = False
break
if flag:
ans -=(l+1)
break
print(ans)
return
def ex... |
s337882816 | p03952 | u905582793 | 1576856705 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 287 | n,x=map(int,input().split())
if n==2:
if x==2:
print("Yes",1,2,3,sep="\n")
exit()
else:
print("No")
exit()
if x==1 or x==n*2-1:
print("No")
exit()
ans=[i for i in range(1,2n)]
for i in range(len(ans)):
ans[i]=(ans[i]-(n-x+1))%(2*n-1)+1
print("Yes",ans,sep="\n") |
s579595838 | p03952 | u440566786 | 1576232593 | Python | PyPy3 (2.4.0) | py | Runtime Error | 180 | 38384 | 768 | import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
from statistics import median
def median_pyramid(p):
N=len(p)
assert(N&1)
while(N!=1):
p=[median((p[i],p[i+1],p[i+2])) for i in range(N-2)]
N-=2
return p[0]
def resolve()... |
s315706820 | p03952 | u623687794 | 1573136976 | Python | Python (3.4.3) | py | Runtime Error | 111 | 7860 | 270 | n,x=map(int,input().split())
if x==1 or x==2*n-1:print("No")
else:
print("Yes")
b=[0]*n
b[n//2]=x
b[n//2-1]=x-1
b[n//2+1]=x+1
tor=[i+1 for i in range(n)]
del tor[x-2:x+1]
for i in range(n):
if b[i]==0:
b[i]=tor.pop()
for i in b:
print(i)
|
s682661113 | p03952 | u623687794 | 1573136786 | Python | Python (3.4.3) | py | Runtime Error | 127 | 9876 | 279 | n,x=map(int,input().split())
if x==1 or x==n:print("No")
else:
print("Yes")
b=[0]*n
b[n//2]=x
b[n//2-1]=x-1
b[n//2+1]=x+1
tor=[i+1 for i in range(n)]
del tor[x-2:x+1]
print(tor)
for i in range(n):
if b[i]==0:
b[i]=tor.pop()
for i in b:
print(i)
|
s178561905 | p03952 | u623687794 | 1573136365 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 255 | n,x=map(int,input.split())
if x==1 or x==n:print("No")
else:
b=[0]*n
b[n//2]=x
b[n//2-1]=x-1
b[n//2+1]=x+1
tor=[i+1 for i in range(n)]
for i in range(x-2,x+1)
del tor[i]
for i in b:
if i==0:
i=tor.pop()
for i in b:
print(i) |
s496139328 | p03952 | u828766688 | 1572031338 | Python | PyPy3 (2.4.0) | py | Runtime Error | 228 | 77944 | 603 |
N,x = map(int,input().split())
if x <= 2 or 2*N-x <= 2:
print ("No")
else:
print ("Yes")
notend = [True] * (2*N-1)
lis = [0] * (2*N-1)
lis[N-1] = x
notend[x] = False
lis[N] = x+1
notend[x+1] = False
lis[N-2] = x-2
notend[x-2] = False
lis[N+1] = x-1
notend[x-1] = Fal... |
s040041370 | p03952 | u238510421 | 1569711770 | Python | PyPy3 (2.4.0) | py | Runtime Error | 189 | 38432 | 651 | n,x = map(int,input().split())
def get_result():
if x == 1 or x == 2*n-1:
return []
if N == 2:
return [1,2,3]
if x == 2:
center = [3,2,1,4]
others = list(range(5,2*n))
elif x == 2*n-2:
center = [2*n-3,2*n-2,2*n-1,2*n-4]
others = list(range(1,2*n... |
s281670936 | p03952 | u238510421 | 1569711522 | Python | PyPy3 (2.4.0) | py | Runtime Error | 191 | 38576 | 653 | n,x = map(int,input().split())
def get_result():
if x == 1 or x == 2*n-1:
return []
if N == 2:
return [1,2,3]
if x == 2:
center = [3,2,1,4]
others = list(range(5,2*n))
elif x == 2*n-1:
center = [2*n-3,2*n-2,2*n-1,2*n-4]
others = list(range(1,2*n... |
s228704532 | p03952 | u550943777 | 1568231204 | Python | Python (3.4.3) | py | Runtime Error | 277 | 12480 | 1229 | n, x = map(int,input().split())
ans = [-1]*(2*n - 1)
if x == 1 or x == 2*n - 1:
print('No')
else:
if n == 3:
if x == 3:
print('No')
else:
print(1 + '¥n' + 2 + '¥n' + 3)
else:
print('Yes')
t = 0
if x == 2:
ans[n - 3] = 4
... |
s374247118 | p03952 | u550943777 | 1568231076 | Python | Python (3.4.3) | py | Runtime Error | 267 | 12480 | 1382 | n, x = map(int,input().split())
ans = [-1]*(2*n - 1)
if x == 1 or x == 2*n - 1:
print('No')
else:
if n == 3:
if x == 3:
print('No')
else:
print(1 + '¥n' + 2 + '¥n' + 3)
else:
print('Yes')
t = 0
if x == 2:
ans[n - 3] = 4
... |
s718591106 | p03952 | u807772568 | 1568062327 | Python | PyPy3 (2.4.0) | py | Runtime Error | 296 | 52760 | 1540 | import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return map(int,input().split())
def onem(): #Nとかの取得
return int(input())
def s(x): #圧縮
a = []
aa = x[0]
su = ... |
s793043150 | p03952 | u807772568 | 1568061966 | Python | PyPy3 (2.4.0) | py | Runtime Error | 184 | 38768 | 1507 | import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return map(int,input().split())
def onem(): #Nとかの取得
return int(input())
def s(x): #圧縮
a = []
aa = x[0]
su = ... |
s435287955 | p03952 | u807772568 | 1568061023 | Python | PyPy3 (2.4.0) | py | Runtime Error | 292 | 52592 | 1603 | import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return map(int,input().split())
def onem(): #Nとかの取得
return int(input())
def s(x): #圧縮
a = []
aa = x[0]
su = ... |
s557203499 | p03952 | u807772568 | 1568060787 | Python | PyPy3 (2.4.0) | py | Runtime Error | 287 | 52592 | 1537 | import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return map(int,input().split())
def onem(): #Nとかの取得
return int(input())
def s(x): #圧縮
a = []
aa = x[0]
su = ... |
s119337192 | p03952 | u807772568 | 1568060737 | Python | PyPy3 (2.4.0) | py | Runtime Error | 301 | 53664 | 1561 | import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return map(int,input().split())
def onem(): #Nとかの取得
return int(input())
def s(x): #圧縮
a = []
aa = x[0]
su = ... |
s225759051 | p03952 | u807772568 | 1568060400 | Python | PyPy3 (2.4.0) | py | Runtime Error | 306 | 52720 | 1511 | import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return map(int,input().split())
def onem(): #Nとかの取得
return int(input())
def s(x): #圧縮
a = []
aa = x[0]
su = ... |
s312648917 | p03952 | u350248178 | 1568008097 | Python | Python (3.4.3) | py | Runtime Error | 227 | 14488 | 437 | n,x=map(int,input().split())
m=2*n-1
if x==1 or x==m:
print("No")
exit()
ll=list(range(1,2*n))
if x!=2:
l=[x-1,x,x+1,x-2]
ll.remove(x-1)
ll.remove(x)
ll.remove(x+1)
ll.remove(x-2)
else:
l=[x+1,x,x-1,x+2]
ll.remove(x-1)
ll.remove(x)
ll.remove(x+1)
ll.remove(x+2)
ans=[]
fo... |
s039299873 | p03952 | u350248178 | 1568007868 | Python | Python (3.4.3) | py | Runtime Error | 232 | 14060 | 472 | n,x=map(int,input().split())
m=2*n-1
if x==1 or x==m:
print("No")
exit()
ll=list(range(1,2*n))
if x!=2:
l=[x-1,x,x+1,x-2]
ll.remove(x-1)
ll.remove(x)
ll.remove(x+1)
ll.remove(x-2)
else:
l=[x+1,x,x-1,x+2]
ll.remove(x-1)
ll.remove(x)
ll.remove(x+1)
ll.remove(x+2)
ans=[]
k=... |
s663453227 | p03952 | u052499405 | 1560011200 | Python | Python (3.4.3) | py | Runtime Error | 151 | 26548 | 756 | n, x = [int(item) for item in input().split()]
if n == 1 or n == 2*n-1:
print("No")
else:
ans = [0] * (2*n - 1)
used = [0] * (2*n - 1)
if x >= n:
ans[n-1] = 2*n-1
used[2*n-1-1] = 1
ans[n] = x
used[x-1] = 1
ans[n+1] = x-1
used[x-2] = 1
ans[n-2] = x-... |
s187848003 | p03952 | u631277801 | 1550233191 | Python | Python (3.4.3) | py | Runtime Error | 246 | 14128 | 1132 | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**7)
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip(... |
s692612053 | p03952 | u272557899 | 1548883195 | Python | Python (3.4.3) | py | Runtime Error | 267 | 14044 | 1911 | n, x = map(int, input().split())
if x == 1 or x == 2 * n - 1:
print("No")
else:
numli = [i for i in range(1, 2 * n)]
displayli = [0] * (2 * n - 1)
if n == 2:
if x == 2:
print("Yes")
for i in range(3):
print(i + 1)
else:
print("No")
... |
s744085197 | p03952 | u133038626 | 1546624637 | Python | Python (3.4.3) | py | Runtime Error | 232 | 25456 | 854 | # coding: utf-8
import math
import fractions
import heapq
import collections
import re
import array
import bisect
from collections import Counter, defaultdict
II = lambda: int(input())
MI = lambda: map(int, input().split())
def main():
N, x = MI()
if x in [1, 2 * N - 1]:
print("No")
return... |
s200012424 | p03952 | u620868411 | 1540556809 | Python | Python (3.4.3) | py | Runtime Error | 251 | 12512 | 581 | # -*- coding: utf-8 -*-
n,x = map(int, input().split())
if x==1 or x==2*n-1:
print("No")
exit()
if n==2:
print("Yes")
print(1)
print(2)
print(3)
ret = [0 for _ in range(2*n-1)]
if x!=2:
ret[n-1] = x-1
ret[n] = x
ret[n+1] = x+1
ret[n+2] = x-2
d = [x-2,x-1,x,x+1]
else:
re... |
s998530894 | p03952 | u761989513 | 1539217535 | Python | Python (3.4.3) | py | Runtime Error | 264 | 12528 | 1069 | n, x = map(int, input().split())
if x == 1 or x == 2 * n - 1:
print("No")
else:
print("Yes")
if x == 2:
li = list(range(1, 2 * n))
li.remove(x + 1)
li.remove(x)
li.remove(x - 1)
li.remove(x + 2)
k = 0
for i in range(2 * n - 1):
if i == n - ... |
s048591590 | p03952 | u064408584 | 1538617376 | Python | Python (3.4.3) | py | Runtime Error | 165 | 14540 | 240 | n,x=map(int, input().split())
if x==1 or x==2*n+1:print('No')
else:
print('Yes')
a=list(range(1,2*n))
b=[]
b.append(a.pop(x))
b.append(a.pop(x-1))
b.append(a.pop(x-2))
for i in a[:n-2]+b+a[n-2:]:
print(i) |
s615177226 | p03952 | u064408584 | 1538617209 | Python | Python (3.4.3) | py | Runtime Error | 169 | 14540 | 240 | n,x=map(int, input().split())
if x==1 or x==2*n+1:print('No')
else:
print('Yes')
a=list(range(1,2*n))
b=[]
b.append(a.pop(x))
b.append(a.pop(x-1))
b.append(a.pop(x-2))
for i in a[:n-1]+b+a[n-1:]:
print(i) |
s421208069 | p03952 | u690536347 | 1535759004 | Python | Python (3.4.3) | py | Runtime Error | 110 | 8816 | 173 | n,x=map(int,input().split())
if x==1 or x==2*n-1:
print("No")
else:
print("Yes")
l=[0]*(2*n-1)
l[n-2]=x-1
l[n-1]=x
l[n]=x+1
l[n+1]=x-1
print(*l,sep="\n")
|
s520184299 | p03952 | u334712262 | 1534587072 | Python | PyPy3 (2.4.0) | py | Runtime Error | 363 | 68824 | 1648 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permut... |
s661725749 | p03952 | u066337396 | 1521154087 | Python | Python (3.4.3) | py | Runtime Error | 171 | 12488 | 315 | n, x = map(int, input().split())
if x in (1, 2*n - 1):
print('No')
exit()
x -= 1
print('Yes')
l = list(range(1, 2*n))
def s(a, b):
l[a], l[b] = l[b], l[a]
s(n - 1, x)
if x == 1:
s(n - 2, x + 1)
s(n - 3, x - 1)
s(n, x + 2)
else:
s(n - 2, x + 1)
s(n - 3, x - 1)
s(n, x - 2)
for a in l:
print(a) |
s306432218 | p03952 | u976162616 | 1501207468 | Python | Python (3.4.3) | py | Runtime Error | 214 | 12432 | 1095 | import sys
if __name__ == "__main__":
N,X = map(int, input().split())
res = 2 * N - 1
if (X == 1 or X == 2 * N - 1):
print ("No")
sys.exit()
result = [0] * res
left = X - 1
result[N-1] = X
right = X + 1
left_idx = N - 2
right_idx = N
cnt = 0
while (left > 0 a... |
s255900858 | p03952 | u976162616 | 1501199051 | Python | Python (3.4.3) | py | Runtime Error | 226 | 12432 | 1107 | import sys
if __name__ == "__main__":
N,X = map(int, input().split())
res = 2 * N - 1
if (X != N - 1 and X != N and X != N + 1):
print ("No")
sys.exit()
result = [0] * res
left = X - 1
result[N-1] = X
right = X + 1
left_idx = N - 2
right_idx = N
cnt = 0
while... |
s299760422 | p03952 | u687470137 | 1495505051 | Python | Python (3.4.3) | py | Runtime Error | 228 | 12568 | 683 | import sys
if __name__ == '__main__':
N,x = list(map(int,input().split()))
if 1 < x < 2*N - 1:
print('Yes')
L = [i+1 for i in range(2*N - 1)]
ANS = [-1 for i in range(2*N - 1)]
if N != 2:
subset = []
if x == 2:
subset = [x+1,x,x-1,x+2]
... |
s750110782 | p03952 | u687470137 | 1495504369 | Python | Python (3.4.3) | py | Runtime Error | 174 | 12532 | 511 | import sys
if __name__ == '__main__':
N,x = list(map(int,input().split()))
if 1 < x < 2*N - 1:
print('Yes')
L = [i+1 for i in range(2*N - 1)]
if N == 2:
for i in L:
print(i)
else:
L[L.index(x+1)],L[N-2] = L[N-2],x+1
L[L.index(x)... |
s645388479 | p03952 | u687470137 | 1495504113 | Python | Python (3.4.3) | py | Runtime Error | 187 | 12532 | 405 | import sys
if __name__ == '__main__':
N,x = list(map(int,input().split()))
if 1 < x < 2*N - 1:
print('Yes')
L = [i+1 for i in range(2*N - 1)]
L[L.index(x+1)],L[N-2] = L[N-2],x+1
L[L.index(x)],L[N-1] = L[N-1],x
L[L.index(x-1)],L[N] = L[N],x-1
L[L.index(x+2)],L[N+1]... |
s270906178 | p03952 | u345737469 | 1479610256 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 187 | import sys
N, x = map(int, sys.stdin.readline().split())
if N == x:
print('Yes')
print(' '.join(map(lambda x: str(x+1), range(N*2-1))))
else:
print('No') |
s375268359 | p03952 | u820351940 | 1477791102 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 72 | print("No" if K < N else "Yes\n" + "\n".join(map(str, range(1, K * 2)))) |
s472896351 | p03952 | u687206691 | 1477790297 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 118 | n, x = map(int, raw_input().split())
if x == n:
print 'Yes':
for i in xrange(1, 2 * n):
print i
else:
print 'No' |
s860949382 | p03952 | u687206691 | 1477790198 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 117 | n, x = map(int, raw_input().split())
if x == n:
print 'Yes':
for i in range(1, 2 * n):
print i
else:
print 'No' |
s491588982 | p03953 | u657913472 | 1552469065 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 226 | from numpy import*
n,*a=map(int,open(0).read().split())
x=a[:n]
d=diff(x)
t=arange(n-1)
*s,=t
for i in a[-a[n]:]:t[i-2],t[i-1]=t[i-1],t[i-2]
k=a[n+1]
while k:
if k%2:s=t[s]
t=t[t]
k//=2
print(*cumsum([x[0],*d[s]])) |
s862159249 | p03953 | u884982181 | 1543979474 | Python | Python (3.4.3) | py | Runtime Error | 2123 | 1196140 | 498 | import numpy as np
n = int(input())
x = list(map(int,input().split()))
m,k = map(int,input().split())
a = list(map(int,input().split()))
b = []
x2 = []
c = []
for i in range(1,n):
b.append(i-1)
x2.append(x[i]-x[i-1])
for i in range(m):
to = a[i]-1
b[to],b[to-1] = b[to-1],b[to]
bai = np.zeros((n-1,n-1),dtype = "... |
s157548841 | p03953 | u884982181 | 1543978583 | Python | Python (3.4.3) | py | Runtime Error | 2112 | 1086948 | 495 | import copy
import numpy as np
n = int(input())
x = list(map(int,input().split()))
m,k = map(int,input().split())
a = list(map(int,input().split()))
b = []
x2 = []
c = []
for i in range(1,n):
b.append(i-1)
x2.append(x[i]-x[i-1])
for i in range(m):
to = a[i]-1
b[to],b[to-1] = b[to-1],b[to]
bai = np.zeros((n-1,n-... |
s862270823 | p03953 | u169535983 | 1478305638 | Python | Python (2.7.6) | py | Runtime Error | 75 | 14484 | 317 | def main():
pass
if __name__ == '__main__':
main()
N = int(raw_input())
x = map(float, raw_input().split(" "))
M, K = map(float, raw_input().split(" "))
a = map(float, raw_input().split(" "))
for k in range(K):
for rab in a:
x[rab-1] = x[rab-2] + x[rab] - x[rab-1]
for rab in x:
print rab
|
s837122532 | p03953 | u104282757 | 1477799377 | Python | Python (2.7.6) | py | Runtime Error | 265 | 20156 | 325 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(int, raw_input().split())
a_list = map(int, raw_input().split())
for k in range(K):
for a in a_list:
x_vec[a] = x_vec[a-1] + x_vec[a+1] - x_vec[a]
for i in range(1, N+1):
print x_v... |
s354005821 | p03953 | u104282757 | 1477799239 | Python | Python (2.7.6) | py | Runtime Error | 237 | 20188 | 375 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(int, raw_input().split())
a_list = map(int, raw_input().split())
for k in range(K):
y_vec = x_vec.copy()
for a in a_list:
y_vec[a] = y_vec[a-1] + y_vec[a+1] - y_vec[a]
x_vec = y... |
s074125305 | p03953 | u104282757 | 1477799083 | Python | Python (2.7.6) | py | Runtime Error | 267 | 20188 | 439 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(int, raw_input().split())
a_list = map(int, raw_input().split())
for k in range(K):
y_vec = x_vec.copy()
for a in a_list:
y_vec[a] = y_vec[a-1] + y_vec[a+1] - y_vec[a]
if np.arr... |
s229427092 | p03953 | u104282757 | 1477798968 | Python | Python (2.7.6) | py | Runtime Error | 276 | 20188 | 440 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(int, raw_input().split())
a_list = map(int, raw_input().split())
for k in range(K):
y_vec = x_vec.copy()
for a in a_list:
y_vec[a] = y_vec[a-1] + y_vec[a+1] - y_vec[a]
if np.arr... |
s779108295 | p03953 | u104282757 | 1477798770 | Python | Python (2.7.6) | py | Runtime Error | 24 | 2568 | 393 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(int, raw_input().split())
a_list = map(int, raw_input().split())
y_vec = x_vec.copy()
for a in a_list:
y_vec[a] = y_vec[a-1] + y_vec[a+1] - y_vec[a]
if np.array_equal(x_vec, y_vec):
break
e... |
s268796915 | p03953 | u104282757 | 1477798400 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2696 | 386 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(int, raw_input().split())
a_list = map(int, raw_input().split())
y_vec = x_vec.copy()
for a in a_list:
y_vec[a] = y_vec[a-1] + y_vec[a+1] - y_vec[a]
if np.array_equal(x_vec, y_vec):
break
e... |
s972219222 | p03953 | u104282757 | 1477798073 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 386 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(int, raw_input().split())
a_list = map(int, raw_input().split())
y_vec = x_vec.copy()
for a in a_list:
y_vec[a] = y_vec[a-1] + y_vec[a+1] - y_vec[a]
if np.array_equal(x_vec, y_vec):
break
e... |
s515736757 | p03953 | u104282757 | 1477796996 | Python | Python (2.7.6) | py | Runtime Error | 210 | 20188 | 418 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()))
M, K = map(long, raw_input().split())
a_list = map(int, raw_input().split())
for k in range(K):
y_vec = x_vec.copy()
for a in a_list:
y_vec[a] = y_vec[a-1] + y_vec[a+1] - y_vec[a]
if np.array_equal(x_vec,... |
s877623229 | p03953 | u104282757 | 1477796659 | Python | Python (2.7.6) | py | Runtime Error | 1343 | 20060 | 434 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(long, raw_input().split())
a_list = map(int, raw_input().split())
for k in range(K):
y_vec = x_vec.copy()
for a in a_list:
y_vec[a] = y_vec[a-1] + y_vec[a+1] - y_vec[a]
if np.ar... |
s102504160 | p03953 | u104282757 | 1477795021 | Python | Python (2.7.6) | py | Runtime Error | 203 | 20156 | 324 | import numpy as np
N = int(raw_input())
x_vec = np.array([0] + map(int, raw_input().split()), dtype='double')
M, K = map(int, raw_input().split())
a_list = map(int, raw_input().split())
for k in range(K):
for a in a_list:
x_vec[a] = x_vec[a-1] + x_vec[a+1] - x_vec[a]
for i in range(1, N+1):
print x_ve... |
s234222482 | p03953 | u191819389 | 1477793140 | Python | Python (2.7.6) | py | Runtime Error | 92 | 14484 | 256 | n = int(raw_input())
x = map(float, raw_input().split())
m, k = map(int, raw_input().split())
a = map(int, raw_input().split())
for i in range(k):
for j in a:
x[j-1] = ((2 * x[j] - x[j-1]) + (2 * x[j-2] - x[j-1])) / 2
for i in x:
print i
|
s026769912 | p03954 | u407160848 | 1571293027 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38384 | 750 | import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)
from statistics import median
def s(generator, splitter, mapper):
return [ mapper(s) for s in generator().split(splitter) ]
# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
return [ int(s) for s in... |
s269056603 | p03954 | u407160848 | 1571292939 | Python | PyPy3 (2.4.0) | py | Runtime Error | 179 | 38256 | 767 |
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)
from statistics import median
def s(generator, splitter, mapper):
return [ mapper(s) for s in generator().split(splitter) ]
# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
return [ int(s) for s i... |
s451808705 | p03954 | u102461423 | 1569648097 | Python | Python (3.4.3) | py | Runtime Error | 367 | 31360 | 746 | import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
import numpy as np
N = int(readline())
A = np.array(readline().split(),np.int32)
def test(x):
# 答はx以上
B = (A >= x)
# 連番の左側にフラグを立てる
flag = np.zeros(N+N-1,np.bool)
flag[:-1] = (B[:-1] == B[1:])
# 最寄りの連番を探す
L = np.where... |
s704705686 | p03954 | u476418095 | 1543544360 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 646 | #include<bits/stdc++.h>
#define N 200005
using namespace std;
inline void rd(int &x){
x=0;char ch=0;int w=0;
while(!isdigit(ch)) ch=getchar(),w|=ch=='-';
while( isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
x=w?-x:x;
}
int l,r;
int n,m;
int a[N],b[N];
bool ok(int x){
for(int i=1;i<=m;i++)
b[i]=(a[i]>=x);... |
s868631677 | p03954 | u910345011 | 1477795823 | Python | Python (3.4.3) | py | Runtime Error | 328 | 35080 | 504 | #coding:utf8
import numpy as np
def mid(a, b, c):
li = [a,b,c]
li.sort()
return li[1]
N = int(input())
an = list(map(int,input().split()))
np.set_printoptions(precision=0)
# N = 4
# an = [1,6,3,7,4,5,2]
a = np.empty((N,2*N-1))
for i in range(2*N-1):
a[N-1,i] = an[i]
# print(a)
# print(a[1,1])
# print(mid(a[0,0... |
s774884088 | p03957 | u005977014 | 1599146310 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9032 | 247 | s=list(map(str,input()))
if 'C' in s and 'F' in s:
if s.index('C')<s.index('F'):
print('Yes')
else:
s.remove(s[s.index('F')])
if s.index('C')<s.index('F'):
print('Yes')
else:
print('No')
else:
print('No')
exit() |
s004387527 | p03957 | u395202850 | 1598066993 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9380 | 321 | import collections
def main():
s = list(input())
if s.count("C") == 0 or s.count("F") == 0:
print("No")
return
if s.index("C") == len(s) - 1:
print("No")
return
print("Yes" if s.index("C") < s.index("F", s.index("C")) else "No")
if __name__ == '__main__':
main()... |
s849893485 | p03957 | u693694535 | 1597111063 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9000 | 126 | s=input()
A=s.index('C')
for i in range(A,len(s)):
if s[i]=='F':
print('Yes')
break
else:
print('No') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.