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
s559894024
p03673
u921773161
1565033967
Python
Python (3.4.3)
py
Runtime Error
72
26180
255
n = int(input()) a = list(map(int, input().split())) b = [] c = [] for i in range(n): if i%2 == 0: b.appendleft(str(a[i])) else: b.append(str(a[i])) if n%2 == 0: ans = b[::-1] else: ans = b ans = ' '.join(ans) print(ans)
s190517481
p03673
u626337957
1564834269
Python
Python (3.4.3)
py
Runtime Error
109
25156
243
N = input() nums = list(map(int, input().split())) odd = [] even = [] for idx, num in enumerate(nums): if idx%2 == 0: even.append(num) else: odd.append(num) if N%2 == 0: print(' '.join(even+odd)) else: print(' '.join(odd+even))
s490289694
p03673
u228294553
1563898574
Python
Python (3.4.3)
py
Runtime Error
17
2940
284
n=int(input()) a_L=list(input().split()) ans1 :list=[] ans2 :list=[] if n==1: print(a_L[0]) else: for i in range(0,n,2): ans2.append(a_L[i]) for i in range(1,n,2): ans1.append(a_L[i]) if n%2==0: ans1.reverse() print(*(ans1+ans2)) else: ans2.reverse() print(*(ans2+ans1))
s470515705
p03673
u050708958
1563646571
Python
Python (3.4.3)
py
Runtime Error
129
25412
254
from collections import deque n = int(input()) a = [int(i) for i in input().split()] odd = deque() even = deque() for i, v in enumerate(a): if (i + 1) % 2: odd.appendleft(v) else: even.appendleft(v) print(*(odd + even) if n % 2 else (even + odd))
s631464144
p03673
u573272932
1562640437
Python
Python (3.4.3)
py
Runtime Error
18
2940
81
n = int(input()) a = list(map(int, input().split())) print(*a[::-2], *a[n%2::2])
s883834967
p03673
u537859408
1561488324
Python
Python (3.4.3)
py
Runtime Error
17
2940
76
n=int(input()) a=list(map(int,input().split())) print(*a[-1::-2],*a[n%2::2])
s902725857
p03673
u172111219
1560883933
Python
PyPy3 (2.4.0)
py
Runtime Error
166
38384
349
n =int(input()) a = [str(x) for x in input().split()] ls = [] ls.append(a[0) if n%2==0: for i in range(1,n): if i%2==0: ls.append(a[i]) else: ls.insert(0,a[i]) else: for i in range(1,n): if i%2==1: ls.append(a[i]) else: ls.insert...
s738371646
p03673
u539517139
1560880823
Python
Python (3.4.3)
py
Runtime Error
99
26180
278
n=int(input()) a=list(map(int,input().split())) b=[] if len(a)%2==0: for i in range(n-1,0,-2): b.append(a[i]) for i in range(0,n-2,2): b.append(a[i]) else: for i in range(n,-1,-2): b.append(a[i]) for i in range(1,n-1,2): b.append(a[i]) print(' '.join(b))
s909712774
p03673
u623687794
1560631777
Python
Python (3.4.3)
py
Runtime Error
71
26356
199
n=int(input()) l=list(map(int,input().split())) if n%2==1: l=l[n-1::-2]+l[1::2] for i in range(5): print(l[i],end=" ") else: l=l[n-1::-2]+l[::2] for i in range(5): print(l[i],end=" ")
s487184888
p03673
u565149926
1558809447
Python
Python (3.4.3)
py
Runtime Error
17
2940
111
n = int(input()) a = list(map(int, input().split())) print(*reversed(a[(len(a)+1) % 2::2]), *a[len(a) % 2::2])
s404424797
p03673
u163320134
1558560544
Python
Python (3.4.3)
py
Runtime Error
25
7260
223
import collections n=int(input()) arr=list(map(int,input())) q=collections.deque() for i in range(n): if i%2==0: q.append(arr[i]) else2 q.appendleft(arr[i]) if i%2==1: q=list(q)[::-1] print(' '.join(map(str,q)))
s690103286
p03673
u687044304
1558359233
Python
Python (3.4.3)
py
Runtime Error
41
19536
1417
# -*- coding:utf-8 -*- from collections import deque def solve(): n = int(input()) A = input().split() """方針 A = 0 6 7 6 7 0 i | b --------------- 1 | 0 2 | 0 6 (本当は逆で6 0) 3 | 7 0 6 4 | 7 0 6 6 (本当は逆で 6 6 0 7) 5 | 7 7 0 6 6 6 | 7 7 0 6 6 0 (本当は逆で0 6 6 0 7 7) ・iが偶数...
s003434614
p03673
u874723578
1557098395
Python
Python (3.4.3)
py
Runtime Error
17
2940
80
n = int(input()) a = list(map(int, input().split())) print(*a[::-2], *a[n%2::2])
s789749150
p03673
u874723578
1557098355
Python
Python (3.4.3)
py
Runtime Error
17
2940
68
n, *a = map(int, open(0).read().split()) print(*a[::-2], *a[n%2::2])
s179053303
p03673
u859897687
1556025659
Python
Python (3.4.3)
py
Runtime Error
43
7864
118
n=int(input()) a=input() ans="" for i in range(n-1,-1,-2): ans+=a[i] for i in range(n%a,n,2): ans+=a[i] print(ans)
s845603644
p03673
u859897687
1556023872
Python
Python (3.4.3)
py
Runtime Error
58
19152
126
n=int(input()) a=input().split() ans="" for i in range(n-1,-1,-2): ans+=a[i] for i in range(n%a,n,2): ans+=a[i] print(ans)
s099868718
p03673
u844005364
1555631650
Python
Python (3.4.3)
py
Runtime Error
21
8028
206
n = int(input()) a = list(map(int, input())) import collections b = collections.deque() for i in range(n): if i % 2 == n % 2: b.appendleft(a[i]) else: b.append(a[i]) print(*b)
s746820920
p03673
u844005364
1555631615
Python
Python (3.4.3)
py
Runtime Error
17
2940
196
n = int(input()) a = list(map(int, input())) import collections b = collections.deque() for i in range(n): if i %% 2 == n %% 2: b.appendleft(a[i]) else: b.append(a[i]) print(*b)
s510399507
p03673
u655975843
1555285598
Python
Python (3.4.3)
py
Runtime Error
84
25544
621
import sys import collections ns = lambda: sys.stdin.readline().rstrip() ni = lambda: int(ns()) nm = lambda: map(int, sys.stdin.readline().split()) nl = lambda: list(nm()) nsl = lambda: map(str, sys.stdin.readline().split()) n = ni() a = collections.deque(nl()) ans = collections.deque() if n % 2 == 0: for i in ran...
s691272582
p03673
u655975843
1555285535
Python
Python (3.4.3)
py
Runtime Error
109
25924
621
import sys import collections ns = lambda: sys.stdin.readline().rstrip() ni = lambda: int(ns()) nm = lambda: map(int, sys.stdin.readline().split()) nl = lambda: list(nm()) nsl = lambda: map(str, sys.stdin.readline().split()) n = ni() a = collections.deque(nl()) ans = collections.deque() if n % 2 == 0: for i in ran...
s584631895
p03673
u268516119
1555193433
Python
Python (3.4.3)
py
Runtime Error
201
29620
566
import sys fastinput=sys.stdin.readline N=int(input()) a=[int(i) for i in fastinput().split()] result=[None]*N if N%2:#odd c=(N-1)//2 for num,i in enumerate(a): r=(num+1)//2 if num==0: result[c]=i else: if num%2:#右半分 result[c+r]=i else:...
s532356989
p03673
u217940964
1554323258
Python
Python (3.4.3)
py
Runtime Error
2105
26020
123
N = int(input()) A = list(map(int, input().split())) B = list() for a in A: B.append(a) B = B[::-1] print(" ".join(B))
s921801895
p03673
u565204025
1554248204
Python
Python (3.4.3)
py
Runtime Error
17
2940
407
n = int(input()) a = list(map(int,input().split())) b = ["A" for i in range(1000001)] for i in range(n): if i % 2 != 0: b.append(a[i]) else: b[1000000-i] = a[i] while b[0] == "A" : del b[0] while "A" in b: b.remove("A") if n % 2 != 0: pass else: b.reverse() for i in range(len(b)...
s487797874
p03673
u565204025
1554248062
Python
Python (3.4.3)
py
Runtime Error
78
26180
430
# -*- coding: utf-8 -*- n = int(input()) a = list(map(int,input().split())) b = ["A" for i in range(1001)] for i in range(n): if i % 2 != 0: b.append(a[i]) else: b[1000-i] = a[i] while b[0] == "A" : del b[0] while "A" in b: b.remove("A") if n % 2 != 0: pass else: b.reverse()...
s476608955
p03673
u013408661
1554246889
Python
Python (3.4.3)
py
Runtime Error
22
7004
179
n=int(input()) a=list(map(int,input())) b=[] c=[] for i in range(n): if i%2==0: b.append(a[i]) else: c.append(a[i]) b.reverse() b.extend(c) print(' '.join(map(str,b)))
s176724099
p03673
u390901416
1551998955
Python
Python (3.4.3)
py
Runtime Error
1325
144964
178
n = int(input()) # a = list(map(int, input().split())) a = [int(i) for i in input().split()] b = [] for i in range(len(a)): b.append(a[i]) b = b[::-1] print(b)
s145767145
p03673
u853900545
1551366520
Python
Python (3.4.3)
py
Runtime Error
70
26020
86
n = int(input()) a = list(map(int,input().split())) print(" ".join(a[::-2]+a[n%2::2]))
s490133692
p03673
u853900545
1551366477
Python
Python (3.4.3)
py
Runtime Error
74
26180
86
n = int(input()) a = list(map(int,input().split())) print(' '.join(a[::-2]+a[n%2::2]))
s681308441
p03673
u853900545
1551366443
Python
Python (3.4.3)
py
Runtime Error
73
26180
85
n = int(input()) a = list(map(int,input().split())) print(''.join(a[::-2]+a[n%2::2]))
s453308829
p03673
u549497563
1550609865
Python
Python (3.4.3)
py
Runtime Error
132
26020
192
n = int(input()) a = list(map(int,input().split())) def dp (x): if x==1: return [a[0]] else: c = dp(x-1)+[a[x-1]] return c[::-1] print(" ".join(map(str,dp(n))))
s682819580
p03673
u232429509
1548195828
Python
Python (3.4.3)
py
Runtime Error
18
2940
980
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<cmath> #include<cstdio> #include<map> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define REP(i,s,n) for(int i=(s);i<(n);i++) #define repr(i,n) for(int i=n-1;i>=0;i--) #define REPR(i,s,n) for(int i=(s);i>=(n);i--) #defi...
s470035749
p03673
u785578220
1547839146
Python
Python (3.4.3)
py
Runtime Error
18
2940
168
a = ai() x = lma() k = [0]*a s = 0 t = 0 for i in range(a): if i%2==0: k[s] = x[-1-i] s+=1 else: k[-t-1] = x[-1-i] t+=1 print(k)
s321492690
p03673
u597374218
1547748946
Python
Python (3.4.3)
py
Runtime Error
18
2940
74
N=int(input()) A=list(map(int,input().split())) print(*A[::-2],*A[N%2::2])
s920480020
p03673
u142415823
1544058092
Python
Python (3.4.3)
py
Runtime Error
172
29764
266
n = int(input()) a = list(map(int, input().split())) b = [0 for _ in range(n)] i = 0 j = n - 1 while(j > 0): b[i] = a[j] i += 1 j -= 2 j = 1 if j == 0 else 0 while(i < n): b[i] = a[j] i += 1 j += 2 ans = ' '.join(map(str, b)) print(ans)
s069144777
p03673
u792333798
1541297807
Python
Python (3.4.3)
py
Runtime Error
1266
144804
142
n = int(input()) a = list(map(int, input().strip().split(' '))) b = [] for i in range(n): b.append(a[i]) print(b) b.reverse() print(b)
s329676619
p03673
u455696302
1541291370
Python
Python (3.4.3)
py
Runtime Error
78
25412
377
from collections import deque N = int(input()) A = [int(i) for i in input().split()] B = deque(maxlen=2*10**5) if N % 2 == 0: for i in range(N): if i % 2 == 0: B.append(A[i]) else: B.insert(0,A[i]) else: for i in range(N): if i % 2 == 0: B.insert(0,...
s189868419
p03673
u455696302
1541291334
Python
Python (3.4.3)
py
Runtime Error
81
25412
379
from collections import deque N = int(input()) A = [int(i) for i in input().split()] B = deque(maxlen=2*10**5) if N % 2 == 0: for i in range(N): if i % 2 == 0: B.append(A[i]) else: B.insert(0,A[i]) else: for i in range(N): if i % 2 == 0: B.insert(...
s713096204
p03673
u631277801
1537396527
Python
Python (3.4.3)
py
Runtime Error
229
25532
246
from collections import deque n = int(input()) a = list(map(int,input().split())) b = deque([]) for i,ai in enumerate(a): if i%2 == 0: b.append(ai) else: b.appendleft(ai) if n%2 == 1: print(*b[::-1]) else: print(*b)
s347215122
p03673
u073775598
1536283604
Python
Python (3.4.3)
py
Runtime Error
2104
25744
280
#ABC066C n=int(input()) a=list(map(int, input().split())) front=[] back=[] flg=n%2 for i in range(n//2): front.insert(0, a[2*i-flg+1]) #back.append(a[2*i+flg]) back=[a[2*i+flg] for i in range(n)] if flg==1: front.insert(0, a[n-1]) print(' '.join(map(str, front+back)))
s490567622
p03673
u667024514
1535644857
Python
Python (3.4.3)
py
Runtime Error
74
25156
205
n = int(input()) lis = list(map(int,input().split())) li = lis[::2] l = lis[1::2] if n % 2 == 0: l = l[::-1] ans = l+li print(" ".join(ans)) else: li = li[::-1] ans = li+l print(" ".join(ans))
s295678353
p03673
u667024514
1535644593
Python
Python (3.4.3)
py
Runtime Error
2104
26180
429
n = int(input()) lis = list(map(int,input().split())) li =[] cou = 0 key = 0 if n % 2 == 1: while cou < n: if key == 0: li.insert(0,lis[cou]) cou += 1 key = 1 else: li.append(lis[cou]) cou += 1 key = 0 else: while cou < n: if key == 0: li.append(lis[cou]) ...
s355415984
p03673
u599547273
1533364488
Python
Python (3.4.3)
py
Runtime Error
17
2940
70
print(" ".join((a[1::2][::-1] + a[::2])[::1 if len(a)%2==0 else -1]))
s739324865
p03673
u787562674
1529627821
Python
Python (3.4.3)
py
Runtime Error
17
2940
479
from collections import deque n = int(input()) result = deque() index = 0 if n % 2 == 0 for i in input().split(): if index % 2 == 1: result.appendleft(i) index += 1 else: result.append(i) index += 1 else: for i in input().split(): if ind...
s124919013
p03673
u327248573
1525480316
Python
Python (3.4.3)
py
Runtime Error
135
26180
355
n = int(input()) a = list(map(int, input().split(' '))) b = [0] * n K = [0] * n def hopping(j): if j == 1: return 0 else: K[j-1] = ((-1)**(j-1))*2*(j-1)+hopping(j-1) return K[j-1] hopping(n) if n % 2 == 0: for i in range(n): b[(n+K[i])//2] = a[i] else: for i in range(n): ...
s603070931
p03673
u766407523
1524709992
Python
Python (3.4.3)
py
Runtime Error
18
3064
229
n = int(input()) a = list(map(int,input().split())) f, r = [], [] for i in range(n): if i%2==0: f.append(a[i]) else: r.append(a[i]) if n%2==0: print(*r[::-1], *f) else: print(*f[::-1], *r)
s412257666
p03673
u050428930
1523898140
Python
Python (3.4.3)
py
Runtime Error
151
19908
103
N=int(input()) s=list(input().split()) t=s[5::-2]+s[0::2] for i in range(N): print(t[i],end=" ")
s898532791
p03673
u842230338
1522874817
Python
Python (3.4.3)
py
Runtime Error
17
2940
74
n - int(input()) a = input().split() s = a[::-2]+a[::2] print(" ".join(s))
s123440866
p03673
u941884460
1521052183
Python
Python (3.4.3)
py
Runtime Error
17
2940
253
n = int(input()) a = input().split() b = [] for i in range(n): if n%2 == 0: if i%2== 1: b.insert(0,a[i]) else: b.append(a[i]) else: if i%2== 0: b.insert(0,a[i]) else: b.append(a[i]) result= map(b) print(result)
s297836923
p03673
u062655521
1517559203
Python
Python (3.4.3)
py
Runtime Error
2105
21584
313
n=int(input()) origin = list(input().split(' ')) ans = [] if (n%2==0): #even for i in range(int(n/2)): ans.append(origin[2*i]) ans.insert(0,origin[2*i+1]) else: #odd ans =ans.append(origin[0]) for i in range(int((n-1)/2)): ans.append(origin[2*i+1]) ans.insert(0,origin[2*i+2]) print(' '.join(ans))
s717087382
p03673
u018679195
1514352683
Python
Python (2.7.6)
py
Runtime Error
26
8448
110
_ = input() args = input() a = [] for i in args.split(' '): a.append(i) a.reverse() print(' '.join(a))
s887638273
p03673
u789417951
1513916664
Python
Python (3.4.3)
py
Runtime Error
17
2940
214
N=int(input()) A=list(map(str, input().split(' '))) F=A[0::2] L=A[1::2] ans=[] an='' if N%2==0: L.reverse() ans=L+F else: F.reverse() ans=F+L for i in range(N): an=an+' 'str(ans[i]) print(an)
s484136591
p03673
u098968285
1511220154
Python
Python (3.4.3)
py
Runtime Error
39
20176
218
n = int(input()) a = list(reversed(map(int, input().split()))) dp = [0]*n for i in range(n): now = a[i] if i%2 == 0: dp[i//2] = now else: dp[-(i//2 + 1)] = now print(" ".join(map(str, a)))
s181067887
p03673
u359314361
1504651767
Python
Python (3.4.3)
py
Runtime Error
38
20176
150
count, param = input(), map(int, input().split()) r = list() for i in range(count): r.append(param[i]) r.reverse() print(" ".join(map(str, r)))
s153812591
p03673
u666428701
1501372524
Python
Python (3.4.3)
py
Runtime Error
71
26180
178
# -*- coding: utf-8 -*- N = int(input()) a = list(map(int, input().split())) if N % 2 == 0: print(" ".join(a[N::-2] + a[::2])) else: print(" ".join(a[N::-2] + a[1::2]))
s130127427
p03673
u666428701
1501372483
Python
Python (3.4.3)
py
Runtime Error
16
2940
176
# -*- coding: utf-8 -*- N = int(input()) a = list(map(int, input().split())) if N % 2 == 0: print(" ".join(a[N::-2] + a[::2]) else: print(" ".join(a[N::-2] + a[1::2])
s109560519
p03673
u010110540
1500687171
Python
Python (3.4.3)
py
Runtime Error
74
25540
211
from collections import deque n = int(input()) a = list(map(int, input().split())) b = deque() for i in range(n): if (i+1) %2 == n % 2: b.insert(0, a[i]) else: b.append(a[i]) print(*b)
s914283448
p03673
u010110540
1500687093
Python
Python (3.4.3)
py
Runtime Error
75
25540
211
from collections import deque n = int(input()) a = list(map(int, input().split())) b = deque() for i in range(n): if (i+1) %2 == n % 2: b.insert(0, a[i]) else: b.append(a[i]) print(*b)
s422817379
p03673
u889811773
1500138709
Python
Python (3.4.3)
py
Runtime Error
1014
149316
180
num = int(input()) s = input().split(" ") b = [] ans = "" for i in range(num): b.append(s[i]) b.reverse() print(b) for char in b: ans += char + " " print(ans[:-1])
s153971386
p03673
u360765331
1499900628
Python
Python (3.4.3)
py
Runtime Error
17
2940
626
#include <iostream> #include <string.h> #define NUM 100000 using namespace std; int main(void) { int a[200001]; int n,x=1,flag; cin >> n; cin >> a[NUM]; if (n%2 == 0) { flag = 0; } else { flag = 1; } if (flag == 0) { for (int i=0;i<n-1;i++) { if (i%2 == 0) { cin >> a[NUM-x]; } else { ci...
s691110887
p03673
u360765331
1499868865
Python
Python (3.4.3)
py
Runtime Error
21
7868
161
a = int(input()) list = [] for i in range(a): c = input(); if i%2 == 1: list.insert(0, c) else: list.append(c) for i in range(a): print(list[i],end=" ")
s183346434
p03673
u343437894
1499649502
Python
Python (3.4.3)
py
Runtime Error
1247
144804
171
n = int(input()) a = list(map(int, input().split(" "))) b=[] for item in a: b.append(item) b.reverse() print(item,b) for item in b: print(item, end=" ")
s263183471
p03673
u343437894
1499649249
Python
Python (3.4.3)
py
Runtime Error
17
2940
150
n = int(input()) a = list(map(int, input().split(" ")) b=[] for item in a: b.append(item) b.reverse for item in b: print(item, end=" ")
s381603087
p03673
u079937957
1498968808
Python
Python (3.4.3)
py
Runtime Error
17
2940
166
n = input() a = map(int, raw_input().split()) b = [] for i in range(n): if i%2 == 0: b.append(a[i]) else: b.insert(0,a[i]) print(' '.join(b))
s132261021
p03673
u016933855
1498968314
Python
Python (3.4.3)
py
Runtime Error
70
26360
330
quant = int(input()) nums = list(map(int, input().split())) data = [] for i in range(quant): if i % 2 == 0: data.append(nums[i]) else: data = nums[i] + data if quant % 2 == 0: for i in data: print(i, end=" ") else: for i in reversed(range(quant)): print(data[i],...
s921175649
p03673
u794543767
1498964072
Python
Python (3.4.3)
py
Runtime Error
389
45088
280
import numpy as np n = int(input()) A = input() a = list(map(int,A.split(" "))) a = np.array(a) if n%2 == 0: b = np.append(even[::-1],odd) else: b = np.append(odd[::-1],even) import sys for d in b[:-1]: sys.stdout.write(str(d)+ " ") sys.stdout.write(str(b[-1])+"\n")
s954826486
p03673
u108617242
1498963759
Python
Python (3.4.3)
py
Runtime Error
67
26020
175
n = int(input()) a = list(map(int, input().split())) for i in range(n): if i % 2 == n % 2: b.insert(0, a[i]) else: b.append(a[i]) for x in b: print(x, end=' ') print()
s348325646
p03673
u108617242
1498963708
Python
Python (3.4.3)
py
Runtime Error
65
26016
175
n = int(input()) a = list(map(int, input().split())) for i in range(n): if i % 2 == n & 2: b.insert(0, a[i]) else: b.append(a[i]) for x in b: print(x, end=' ') print()
s776364035
p03673
u016933855
1498963104
Python
Python (3.4.3)
py
Runtime Error
71
26020
363
quant = input() nums = list(map(int, input().split())) for i in nums: if i == 1: data = [nums[i]] continue elif i % 2 == 1: data.append(nums[i]) else: data.insert(0, nums[i]) if quant % 2 == 0: for i in data: print(data[i], end = ' ') else: for i in data: ...
s948725617
p03673
u780709476
1498963099
Python
Python (3.4.3)
py
Runtime Error
110
27416
197
n = int(input()) a = input().split() b = [0] * len(a) index = 0 for i in range(0,n,2): b[index] = a[n - i - 1] index += 1 for i in range(0,n,2): b[index] = a[i] index += 1 print(b)
s420815566
p03673
u794543767
1498963063
Python
Python (3.4.3)
py
Runtime Error
210
36108
303
import numpy as np n = input() A = input() a = list(map(int,A.split(" "))) a = np.array(a) odd = a[1::2] even = a[0::2] if n//2 == 0: b = np.append(even[::-1],odd) else: b = np.append(odd[::-1],even) import sys for d in b[:-1]: sys.stdout.write(str(d)+ " ") sys.stdout.write(str(b[-1])+"\n")
s392011965
p03673
u744898490
1498962845
Python
Python (3.4.3)
py
Runtime Error
37
20176
635
n = int(input()) abc = input().split(' ') b = [] if n <= 4: for i in abc: b.append(i) b = b [::-1] else: abc = abc[::-1] b = ['0'* n ] b[0] = abc[0] b[-1] = abc[1] l = 1 r = n - 1 for i in range(2, n): if i%2 == 0: b[l] = abc[i] else: ...
s509514284
p03673
u016933855
1498961948
Python
Python (3.4.3)
py
Runtime Error
72
26020
315
quant = input() nums = list(map(int, input().split())) data = [] for i in nums: if i % 2 == 1: data.append(nums[i]) else: data.insert(0, nums[i]) if quant % 2 == 0: for i in data: print(data[i], end = ' ') else: for i in data: print(data[quant - i - 1], end = ' ')
s902834476
p03673
u166636976
1498961890
Python
Python (3.4.3)
py
Runtime Error
37
20016
148
N = int(input()) char = input().split() out = [] cnt = 0 while cnt <= N: out.append(char[x]) out.reverse() cnt += 1 print(" ".join(out))
s680488392
p03673
u709121282
1498960636
Python
Python (2.7.6)
py
Runtime Error
10
2568
252
N = input() a=(map(str, raw_input().split())) odd=a[1::2] even=a[0::2] if N%2==0: print ' '.join(reversed(odd))+' '+' '.join(even) else: print ' '.join(reversed(even))+' '+' '.join(odd) ~
s320287660
p03673
u825324821
1498959313
Python
Python (3.4.3)
py
Runtime Error
36
20016
120
n = int(input()) a = input().split(' ') b = [] for i in xrange(n): b.append(a[i]) b = b[::-1] print(' '.join(b))
s183746903
p03673
u393971002
1498959268
Python
Python (3.4.3)
py
Runtime Error
16
2940
679
#include <iostream> #include <queue> using namespace std; #define MAX_N 200000 int n; int a[MAX_N] = {0}; void solve(){ deque<int> di; for(int i = 0; i < n; ++i){ if(i % 2 == 0){ di.push_back(a[i]); }else{ di.push_front(a[i]); } } if(n % 2 == 1){ ...
s167532146
p03674
u425184437
1599744760
Python
PyPy3 (7.3.0)
py
Runtime Error
95
74656
490
N=int(input()) A=list(map(int,input().split())) from collections import Counter two=0 a=Counter(A) for k,v in a.items(): if v==2: two=k LR=[] for i in range(N+1): if A[i]==two: LR.append(i) L=LR[0] R=LR[1] mod=10**9+7 P=[1 for i in range(10**6+1)] for i in range(10**6): P[i+1]=P[i]*(i+1)%mod L+=1 R+=1 def...
s847897510
p03674
u425184437
1599744504
Python
PyPy3 (7.3.0)
py
Runtime Error
425
174884
484
N=int(input()) A=list(map(int,input().split())) from collections import Counter two=0 a=Counter(A) for k,v in a.items(): if v==2: two=k LR=[] for i in range(N): if A[i]==two: LR.append(i) L=LR[0] R=LR[1] mod=10**9+7 P=[1 for i in range(10**6+1)] for i in range(10**6): P[i+1]=P[i]*(i+1)%mod L+=1 R+=1 def c...
s966083629
p03674
u917879786
1599301324
Python
PyPy3 (7.3.0)
py
Runtime Error
173
105404
937
import itertools N = int(input()) A = list(map(int, input().split())) MOD = 10**9 + 7 MAX_NUM = 10**5 def inv_mod(n): return pow(n, MOD-2, MOD) FACTS = [1 for _ in range(MAX_NUM+1)] for n in range(1, MAX_NUM+1): FACTS[n] = (n*FACTS[n-1]) % MOD INV_FACTS = [1 for _ in range(MAX_NUM+1)] INV_FACTS[MAX_NUM] = inv_...
s888381461
p03674
u917879786
1599298264
Python
PyPy3 (7.3.0)
py
Runtime Error
94
74860
201
import iterools n = int(input()) a = map(int, input().split()) for i in range(n+1): if i == len(n): print(1) else: combos = list(itertools.combinations(a, i)) print(len(set(combos)))
s703530062
p03674
u917879786
1599298191
Python
PyPy3 (7.3.0)
py
Runtime Error
84
68632
194
import iterools n = int(input()) a = map(int, input().split()) for i in range(n): if i == len(n)-1: print(1) else: combos = itertools.combinations(a, i) print(len(set(combos)))
s090144559
p03674
u107639613
1596764454
Python
PyPy3 (7.3.0)
py
Runtime Error
2338
3488752
1179
import sys def input(): return sys.stdin.readline().strip() mod = 10**9+7 def main(): N = int(input()) A = list(map(int, input().split())) pre_idx = 0 idx = 0 appeared = [-1] * (N + 1) for i, a in enumerate(A): if appeared[a] == -1: appeared[a] = i else: ...
s618138149
p03674
u107639613
1596764394
Python
PyPy3 (7.3.0)
py
Runtime Error
2301
3520200
1232
import sys def input(): return sys.stdin.readline().strip() mod = 10**9+7 def main(): N = int(input()) A = list(map(int, input().split())) pre_idx = 0 idx = 0 appeared = [-1] * (N + 1) for i, a in enumerate(A): if appeared[a] == -1: appeared[a] = i else: ...
s755034119
p03674
u786020649
1595896940
Python
Python (3.8.2)
py
Runtime Error
25
9040
1644
import sys finput=lambda:sys.stdin.readline().strip() def main(): p=10**9+7 n=int(finput()) a=list(map(int,finput().split())) k=sum(a)-(n*(n+1))//2 pk=[i for i in range(n+1) if a[i]==k] fact=[1]*(n+2) ifact=[1]*(n+2) for i in range(1,n+2): fact[i]=fact[i-1]*i % p a=fact[-1] ...
s057581042
p03674
u786020649
1595896910
Python
Python (3.8.2)
py
Runtime Error
24
8976
1727
import sys finput=lambda:sys.stdin.readline().strip() def main(): p=10**9+7 n=int(finput()) a=list(map(int,finput().split())) k=sum(a)-(n*(n+1))//2 pk=[i for i in range(n+1) if a[i]==k] fact=[1]*(n+2) ifact=[1]*(n+2) for i in range(1,n+2): fact[i]=fact[i-1]*i % p a=fact[-1] ...
s368228826
p03674
u786020649
1595896601
Python
Python (3.8.2)
py
Runtime Error
29
9016
862
import sys finput=lambda:sys.stdin.readline().strip() def main(): p=10**9+7 n=int(finput()) a=list(map(int,finput().split())) k=sum(a)-(n*(n+1))//2 pk=[i for i in range(n+1) if a[i]==k] fact=[1]*(n+2) ifact=[1]*(n+2) for i in range(1,n+2): fact[i]=fact[i-1]*i % p a=fact[-1] ...
s574578696
p03674
u790616011
1594499600
Python
PyPy3 (7.3.0)
py
Runtime Error
126
101716
1025
def comb(n, r, mod): if (r < 0 or r > n): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 # 出力の制限 N = 10**4 g1 = [1, 1] # 元テーブル g2 = [1, 1] # 逆元テーブル inverse = [0, 1] # 逆元テーブル計算用テーブル for i in range(2, N + 1): g1.append((g1[-1] * i) % mod) inverse.append((-in...
s788625341
p03674
u102445737
1592756254
Python
PyPy3 (7.3.0)
py
Runtime Error
97
74600
1123
#from collections import deque,defaultdict printn = lambda x: print(x,end='') inn = lambda : int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda : input().strip() DBG = True and False BIG = 10**18 R = 10**9 + 7 def ddprint(x): if DBG: print(x)...
s258662865
p03674
u263830634
1591238092
Python
Python (3.4.3)
py
Runtime Error
351
19364
1091
import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 9) MOD = 10 ** 9 + 7 class Factorial: def __init__(self, n, mod): self.f = [1] self.mod = mod for j in range(1, n + 1): self.f.append(self.f[-1] * j % mod) self.i = [pow(self.f[-1], mod - 2, mod)] ...
s540283420
p03674
u263830634
1591238026
Python
Python (3.4.3)
py
Runtime Error
338
19364
1022
import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 9) MOD = 10 ** 9 + 7 class Factorial: def __init__(self, n, mod): self.f = [1] self.mod = mod for j in range(1, n + 1): self.f.append(self.f[-1] * j % mod) self.i = [pow(self.f[-1], mod - 2, mod)] ...
s307573150
p03674
u690536347
1590435548
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38256
608
import sys input=sys.stdin.readline def solve(): N = int(input()) d = {i:-1 for i in range(1, N+1)} *l, = map(int, input().split()) MOD = 10**9+7 n = N+1 fac = [1]*(n+1) rev = [1]*(n+1) for i in range(1,n+1): fac[i] = i*fac[i-1]%MOD rev[i] = pow(fac[i], MOD-2, MOD) ...
s099091203
p03674
u690536347
1590435400
Python
PyPy3 (2.4.0)
py
Runtime Error
416
68140
436
N = int(input()) d = {i:-1 for i in range(1, N+1)} *l, = map(int, input().split()) MOD = 10**9+7 n = N+1 fac = [1]*(n+1) rev = [1]*(n+1) for i in range(1,n+1): fac[i] = i*fac[i-1]%MOD rev[i] = pow(fac[i], MOD-2, MOD) comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD if a>=b else 0 for i, j in enumerate(l): i...
s238236796
p03674
u690536347
1590435340
Python
PyPy3 (2.4.0)
py
Runtime Error
431
68012
437
N = int(input()) d = {i:-1 for i in range(1, N+1)} *l, = map(int, input().split()) MOD = 10**9+7 n = N+1 fac = [1]*(n+1) rev = [1]*(n+1) for i in range(1,n+1): fac[i] = i*fac[i-1]%MOD rev[i] = pow(fac[i], MOD-2, MOD) comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD if a>=b else 0 for i, j in enumerate(l): i...
s362777847
p03674
u007550226
1590415445
Python
Python (3.4.3)
py
Runtime Error
42
14008
619
n= int(input()) a= list(map(int,input().split())) check = [0]*(n+1) g1=[1,1] g2=[1,1] inverse=[0,1] for i in range(2,n+1+1): g1.append((g1[-1]*i)%mod) inverse.append((-inverse[mod%i]*(mod//i))%mod) g2.append((g2[-1]*inverse[-1])%mod) def cmb2(n,r): mod = 1000000007 if (r<0 or r>n ): return 0...
s932116881
p03674
u426108351
1588730213
Python
Python (3.4.3)
py
Runtime Error
453
21592
775
n = int(input()) a = list(map(int, input().split())) b = [0]*(n+1) for i in range(n): if b[a[i]] == 0: b[a[i]] += 1 else: d = a[i] l = 0 r = 0 c = 0 for i in range(n+1): if a[i] != d and c == 0: l += 1 elif a[i] != d and c == 2: r += 1 if a[i] == d: c += 1 ...
s277043412
p03674
u057109575
1588520395
Python
PyPy3 (2.4.0)
py
Runtime Error
330
61488
733
N, *X = map(int, open(0).read().split()) MAX = 10 ** 5 MOD = 10 ** 9 + 7 # Factorial fac = [0] * (MAX + 1) fac[0] = 1 fac[1] = 1 for i in range(2, MAX + 1): fac[i] = fac[i - 1] * i % MOD # Inverse factorial finv = [0] * (MAX + 1) finv[MAX] = pow(fac[MAX], MOD - 2, MOD) for i in reversed(range(1, MAX + 1)): ...
s138103689
p03674
u523130469
1587844084
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38384
1018
# 繰り返し二乗法 (mod 有り) def mod_rep_pow(a, n, mod=(10 ** 9 + 7)): res = 1 while n > 0: if n % 2 == 0: a = a ** 2 % mod n //= 2 else: res = res * a % mod n -= 1 return (res % mod) # 繰り返し二乗法 (mod 有り) を利用して nCk を高速に返す # mod が素数のときのみ利用可能 (フェルマーの小定理を利用...
s947115897
p03674
u932465688
1587268389
Python
Python (3.4.3)
py
Runtime Error
367
25716
868
mod = 10**9+7 MAX = 10**5 fact = [1]*(MAX+1) for i in range(1, MAX+1): fact[i] = (fact[i-1]*i)%mod inv = [1]*(MAX+1) for i in range(2, MAX+1): inv[i] = inv[mod%i]*(mod-mod//i)%mod fact_inv = [1] * (MAX + 1) for i in range(1, MAX + 1): fact_inv[i] = fact_inv[i-1]*inv[i]%mod def comb(n, r): if n < r: ...
s640731518
p03674
u683134447
1586986306
Python
PyPy3 (2.4.0)
py
Runtime Error
325
64236
837
n = int(input()) al = list(map(int,input().split())) MOD = 10**9 + 7 N = 10**5 fact = [1]*(N+1) rfact = [1]*(N+1) r = 1 for i in range(1, N+1): fact[i] = r = r * i % MOD rfact[N] = r = pow(fact[N], MOD-2, MOD) for i in range(N, 0, -1): rfact[i-1] = r = r * i % MOD # nPk (mod MOD) を求める def perm(n, k): return fa...
s575494845
p03674
u683134447
1586985329
Python
PyPy3 (2.4.0)
py
Runtime Error
351
66156
819
n = int(input()) al = list(map(int,input().split())) MOD = 10**9 + 7 N = 10**5 fact = [1]*(N+1) rfact = [1]*(N+1) r = 1 for i in range(1, N+1): fact[i] = r = r * i % MOD rfact[N] = r = pow(fact[N], MOD-2, MOD) for i in range(N, 0, -1): rfact[i-1] = r = r * i % MOD # nPk (mod MOD) を求める def perm(n, k): return fa...