s_id string | p_id string | u_id string | date string | language string | original_language string | filename_ext string | status string | cpu_time string | memory string | code_size string | code string | error string | stdout string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s568204099 | p02262 | u839008951 | 1516432515 | Python | Python3 | py | Runtime Error | 5970 | 10616 | 608 | import copy
cnt = 0
def insSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
G = []
i = 1
while True:
G.appe... | Traceback (most recent call last):
File "/tmp/tmpg85s5jln/tmpublzneoi.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s678479000 | p02262 | u839008951 | 1516432734 | Python | Python3 | py | Runtime Error | 6140 | 10616 | 608 | import copy
cnt = 0
def insSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
G = []
i = 1
while True:
G.appe... | Traceback (most recent call last):
File "/tmp/tmp0kzdv924/tmpo01kqfi9.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s225034507 | p02262 | u088372268 | 1517624891 | Python | Python3 | py | Runtime Error | 4020 | 16000 | 502 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, n
while g >= 1:
g //= 2
gap.append(g)
if gap[0]:
gap.remove(0)
m = len(gap)
for i in range(m):
for idx in range(gap[i], n):
j = idx - gap[i]
while j >= 0 and data[j] > data[j+gap[i]]:
dat... | Traceback (most recent call last):
File "/tmp/tmp6cwxn9f_/tmplnxkhy3b.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s355233652 | p02262 | u088372268 | 1517625088 | Python | Python3 | py | Runtime Error | 3840 | 16000 | 502 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, n
while g >= 1:
g //= 2
gap.append(g)
if gap[0]:
gap.remove(0)
m = len(gap)
for i in range(m):
for idx in range(gap[i], n):
j = idx - gap[i]
while j >= 0 and data[j] > data[j+gap[i]]:
dat... | Traceback (most recent call last):
File "/tmp/tmpdarhbpr2/tmp0kr34k_5.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s299944848 | p02262 | u088372268 | 1517625255 | Python | Python3 | py | Runtime Error | 3900 | 16008 | 473 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, n
while g >= 1:
g //= 2
gap.append(g)
m = len(gap)
for i in range(m):
for idx in range(gap[i], n):
j = idx - gap[i]
while j >= 0 and data[j] > data[j+gap[i]]:
data[j+gap[i]], data[j] = data[j... | Traceback (most recent call last):
File "/tmp/tmpo5yixj56/tmpzbo2xalg.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s780435990 | p02262 | u088372268 | 1517625674 | Python | Python3 | py | Runtime Error | 3260 | 16008 | 473 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, n
while g >= 1:
g //= 2
gap.append(g)
m = len(gap)
for i in range(m):
gi = gap[i]
for idx in range(gap[i], n):
j = idx - gap[i]
while j >= 0 and data[j] > data[j+gi]:
data[j+gi], data[j] ... | Traceback (most recent call last):
File "/tmp/tmp0a7doioi/tmpnj6p8dh7.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s199021317 | p02262 | u088372268 | 1517629306 | Python | Python3 | py | Runtime Error | 3280 | 16004 | 438 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, n
while g >= 1:
g //= 2
gap.append(g)
m = len(gap)
for i in gap:
for idx in range(i, n):
j = idx - i
while j >= 0 and data[j] > data[j+i]:
data[j+i], data[j] = data[j], data[j+i]
... | Traceback (most recent call last):
File "/tmp/tmphvmfz2o7/tmpd8gy3rni.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s211904694 | p02262 | u088372268 | 1517633232 | Python | Python3 | py | Runtime Error | 2930 | 16004 | 490 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, 0
while g <= n//9:
g = 3 * g + 1
gap.append(g)
m = len(gap)
gap = [gap[i] for i in range(m-1, -1, -1)]
for i in gap:
for idx in range(i, n):
j = idx - i
while j >= 0 and data[j] > data[j+i]:
... | Traceback (most recent call last):
File "/tmp/tmpyy_n05z8/tmp2lajdr2i.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s903384464 | p02262 | u088372268 | 1517641520 | Python | Python3 | py | Runtime Error | 3100 | 16004 | 490 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, 0
while g <= n//9:
g = 3 * g + 1
gap.append(g)
m = len(gap)
gap = [gap[i] for i in range(m-1, -1, -1)]
for i in gap:
for idx in range(i, n):
j = idx - i
while j >= 0 and data[j] > data[j+i]:
... | Traceback (most recent call last):
File "/tmp/tmp5zmjooef/tmpnd_w48l7.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s709072672 | p02262 | u547838013 | 1517667023 | Python | Python3 | py | Runtime Error | 3000 | 16008 | 489 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, 0
while g <= n//9:
g = 3 * g + 1
gap.append(g)
m = len(gap)
gap = [gap[i] for i in range(m-1, -1, -1)]
for i in gap:
for idx in range(i, n):
j = idx - i
while j >= 0 and data[j] > data[j+i]:
... | Traceback (most recent call last):
File "/tmp/tmprm6ha8jg/tmpscxy6fq7.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s949283832 | p02262 | u996463517 | 1518250198 | Python | Python3 | py | Runtime Error | 1350 | 9836 | 606 | def shellSort(A):
global cnt
cnt = 0
h = 1
g = []
while h <= len(A):
g.append(h)
h = 3*h+1
g.reverse()
m = len(g)
print(m)
print(' '.join(map(str,g)))
for i in range(m):
insertionSort(A,g[i])
def insertionSort(A,g):
global cnt
for i in range... | Traceback (most recent call last):
File "/tmp/tmp56qd_me0/tmp90qa2ks6.py", line 30, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s082095761 | p02262 | u996463517 | 1518250365 | Python | Python3 | py | Runtime Error | 1340 | 9836 | 618 | def insertionSort(A,g):
global cnt
for i in range(g,len(A)):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A):
global cnt
cnt = 0
h = 1
g = []
w... | Traceback (most recent call last):
File "/tmp/tmpdhal1bv6/tmpj152nqz5.py", line 30, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s345268681 | p02262 | u150984829 | 1518270678 | Python | Python3 | py | Runtime Error | 2320 | 10352 | 255 | n=int(input())
s=[1]
c=0
while s[-1]*3<n:s+=[s[-1]*3+1]
s=s[::-1]
a=[int(input())for _ in[0]*n]
for g in s:
for i in range(n):
k=a[i]
j=i-g
while j>=0 and a[j]>k:a[j+g]=a[j];j-=g;c+=1
a[j+g]=k
print(len(s))
print(*s)
print(c)
for x in a:print(x)
| Traceback (most recent call last):
File "/tmp/tmpkm3e7o8i/tmp619kk8yc.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s093704838 | p02262 | u150984829 | 1518271178 | Python | Python3 | py | Runtime Error | 2300 | 10712 | 256 | n=int(input())
a=[int(input())for _ in[0]*n]
s=[1]
c=0
while s[-1]*3<n:s+=[s[-1]*3+1]
s=s[::-1]
for g in s:
for i in range(g,n):
v=a[i]
j=i-g
while j>=0 and a[j]>v:a[j+g]=a[j];j-=g;c+=1
a[j+g]=v
print(len(s))
print(*s)
print(c)
print(*a,sep='\n')
| Traceback (most recent call last):
File "/tmp/tmpgj1bn9iq/tmpzeu7yfyc.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s841201715 | p02262 | u150984829 | 1518271388 | Python | Python3 | py | Runtime Error | 2350 | 10716 | 254 | n=int(input())
a=[int(input())for _ in[0]*n]
s=[1]
c=0
while s[-1]*3<n:s+=[s[-1]*3+1]
s=s[::-1]
for g in s:
for i in range(n):
v=a[i]
j=i-g
while j>=0 and a[j]>v:a[j+g]=a[j];j-=g;c+=1
a[j+g]=v
print(len(s))
print(*s)
print(c)
print(*a,sep='\n')
| Traceback (most recent call last):
File "/tmp/tmptfrdx2z_/tmpy_y7o0f5.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s901182524 | p02262 | u150984829 | 1518271615 | Python | Python3 | py | Runtime Error | 2360 | 10712 | 254 | n=int(input())
a=[int(input())for _ in[0]*n]
s=[1]
c=0
while s[-1]*3<n:s+=[s[-1]*3+1]
s=s[::-1]
for g in s:
for i in range(n):
v=a[i]
j=i-g
while j>=0 and a[j]>v:a[j+g]=a[j];j-=g;c+=1
a[j+g]=v
print(len(s))
print(*s)
print(c)
print(*a,sep='\n')
| Traceback (most recent call last):
File "/tmp/tmpnkbs1re_/tmp82se5tx2.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s310213962 | p02262 | u150984829 | 1518272071 | Python | Python3 | py | Runtime Error | 1840 | 10712 | 304 | n=int(input())
a=[int(input())for _ in[0]*n]
s=[int(pow(4, i) + 3*pow(2, i-1) + 1) for i in range(13)[::-1]] + [1]
s=[v for v in s if v <= n]
c=0
for g in s:
for i in range(n):
v=a[i]
j=i-g
while j>=0 and a[j]>v:a[j+g]=a[j];j-=g;c+=1
a[j+g]=v
print(len(s))
print(*s)
print(c)
print(*a,sep='\n')
| Traceback (most recent call last):
File "/tmp/tmpwtuzhn6a/tmp9u0b3dzp.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s302053204 | p02262 | u150984829 | 1518272295 | Python | Python3 | py | Runtime Error | 2390 | 10716 | 313 | # Runtime Error
n=int(input())
a=[int(input())for _ in[0]*n]
s=[797161,265720,88573,29524,9841,3280,1093,364,121,40,13,4,1]
s=[v for v in s if v <= n]
c=0
for g in s:
for i in range(n):
v=a[i]
j=i-g
while j>=0 and a[j]>v:a[j+g]=a[j];j-=g;c+=1
a[j+g]=v
print(len(s))
print(*s)
print(c)
print(*a,sep='\n')
| Traceback (most recent call last):
File "/tmp/tmpxgrl6gvu/tmpfzhi0ltt.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s789401657 | p02262 | u150984829 | 1518274043 | Python | Python3 | py | Runtime Error | 2330 | 10624 | 410 | n = int(input())
A = [int(input()) for _ in range(n)]
cnt = 0
G = [797161,265720,88573,29524,9841,3280,1093,364,121,40,13,4,1]
G = [v for v in G if v <= n]
m = len(G)
for g in G:
for i in range(n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
... | Traceback (most recent call last):
File "/tmp/tmpcfm667fv/tmpfeeyhpxu.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s312397683 | p02262 | u150984829 | 1518274537 | Python | Python3 | py | Runtime Error | 0 | 0 | 480 | import sys
n = int(input())
A=[int(e)for e in sys.stdin]
cnt = 0
G = [797161,265720,88573,29524,9841,3280,1093,364,121,40,13,4,1]
G = [v for v in G if v <= n]
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A... | Traceback (most recent call last):
File "/tmp/tmpzr5gsmzt/tmpr3uqduv2.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s641597779 | p02262 | u150984829 | 1518274668 | Python | Python3 | py | Runtime Error | 0 | 0 | 424 | import sys
n = int(input())
A=[int(e)for e in sys.stdin]
cnt = 0
G = [797161,265720,88573,29524,9841,3280,1093,364,121,40,13,4,1]
G = [v for v in G if v <= n]
for g in G:
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
... | File "/tmp/tmpf40dcfvk/tmpp342hw60.py", line 8
global cnt
^^^^^^^^^^
SyntaxError: name 'cnt' is assigned to before global declaration
| |
s274202420 | p02262 | u150984829 | 1518274679 | Python | Python3 | py | Runtime Error | 2330 | 10636 | 409 | import sys
n = int(input())
A=[int(e)for e in sys.stdin]
cnt = 0
G = [797161,265720,88573,29524,9841,3280,1093,364,121,40,13,4,1]
G = [v for v in G if v <= n]
for g in G:
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
... | Traceback (most recent call last):
File "/tmp/tmplv_ayig1/tmpu0ki0qfp.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s079788836 | p02262 | u088372268 | 1518653983 | Python | Python3 | py | Runtime Error | 2940 | 15976 | 471 | import sys
n, gap = int(input()), []
data = [int(i) for i in sys.stdin.readlines()]
cnt, g = 0, 0
while g <= n//9:
g = 3 * g + 1
gap.append(g)
m = len(gap)
gap = gap[::-1]
for i in gap:
for idx in range(i, n):
j = idx - i
while j >= 0 and data[j] > data[j+i]:
data[j+i], data[j] ... | Traceback (most recent call last):
File "/tmp/tmp1i51mnte/tmpou5q9x69.py", line 3, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s116218040 | p02262 | u088372268 | 1518654312 | Python | Python3 | py | Runtime Error | 2920 | 16004 | 463 | n, gap = int(input()), []
data = list(map(int, [input() for i in range(n)]))
cnt, g = 0, 0
while g <= n//9:
g = 3 * g + 1
gap.append(g)
m = len(gap)
gap = gap[::-1]
for i in gap:
for idx in range(i, n):
j = idx - i
while j >= 0 and data[j] > data[j+i]:
data[j+i], data[j] = data[j... | Traceback (most recent call last):
File "/tmp/tmpc2r_4cx6/tmp3dk_3u4c.py", line 1, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s878729437 | p02262 | u088372268 | 1518654446 | Python | Python3 | py | Runtime Error | 3040 | 15980 | 471 | import sys
n, gap = int(input()), []
data = [int(i) for i in sys.stdin.readlines()]
cnt, g = 0, 0
while g <= n//9:
g = 3 * g + 1
gap.append(g)
m = len(gap)
gap = gap[::-1]
for i in gap:
for idx in range(i, n):
j = idx - i
while j >= 0 and data[j] > data[j+i]:
data[j+i], data[j] ... | Traceback (most recent call last):
File "/tmp/tmpof5jiaif/tmp7j60v5hs.py", line 3, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s933446982 | p02262 | u088372268 | 1518658342 | Python | Python3 | py | Runtime Error | 2190 | 15980 | 487 | import sys
n, gap = int(input()), []
data = [int(i) for i in sys.stdin.readlines()]
cnt, g = 0, 0
while g <= n//9:
g = 3 * g + 1
gap.append(g)
m = len(gap)
gap = gap[::-1]
for i in gap:
for idx in range(i, n):
j = idx - i
v = data[idx]
while j >= 0 and data[j] > v:
data[... | Traceback (most recent call last):
File "/tmp/tmp8fo3x6cz/tmpw7xck_42.py", line 3, in <module>
n, gap = int(input()), []
^^^^^^^
EOFError: EOF when reading a line
| |
s438793484 | p02262 | u150984829 | 1519781958 | Python | Python3 | py | Runtime Error | 0 | 0 | 468 | import sys
n = int(input())
A = [int(e)for e in sys.stdin]
cnt = 0
G = [int((2.25**i-1)/1.25)for i in range(17,0,-1)]
G = [v for v in G if v <= n]
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
... | Traceback (most recent call last):
File "/tmp/tmpv4nq4zd3/tmp88xmh4v7.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s694061025 | p02262 | u150984829 | 1519865757 | Python | Python3 | py | Runtime Error | 0 | 0 | 611 | import sys
def solve():
n = int(input())
A = list(map(int,sys.stdin))
cnt = 0
G = [int((2.25**i-1)/1.25)for i in range(17,0,-1)]
G = [v for v in G if v <= n]
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while ... | Traceback (most recent call last):
File "/tmp/tmp6jk1ca8i/tmpisq0kyv8.py", line 25, in <module>
solve()
File "/tmp/tmp6jk1ca8i/tmpisq0kyv8.py", line 3, in solve
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s787031607 | p02262 | u613534067 | 1520737734 | Python | Python3 | py | Runtime Error | 1220 | 9896 | 709 | import math
cnt = 0
m = 0
g = []
def insertion_sort(a, n, g):
# cnt+=1 のときにローカルスコープの外を見にいくようにするため
global cnt
for i in range(g, n):
v = a[i]
k = i - g
while k >= 0 and a[k] > v:
a[k+g] = a[k]
k -= g
cnt += 1
a[k+g] = v
def shell_sort(a, n):
... | Traceback (most recent call last):
File "/tmp/tmpm716n4id/tmpwxhf7o6c.py", line 31, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s383008551 | p02262 | u613534067 | 1520738078 | Python | Python3 | py | Runtime Error | 1320 | 9896 | 709 | import math
cnt = 0
m = 0
g = []
def insertion_sort(a, n, g):
# cnt+=1 のときにローカルスコープの外を見にいくようにするため
global cnt
for i in range(g, n):
v = a[i]
k = i - g
while k >= 0 and a[k] > v:
a[k+g] = a[k]
k -= g
cnt += 1
a[k+g] = v
def shell_sort(a, n):
... | Traceback (most recent call last):
File "/tmp/tmphxa2le21/tmp_ul7uzif.py", line 31, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s975530428 | p02262 | u605879293 | 1522648611 | Python | Python3 | py | Runtime Error | 0 | 0 | 467 |
def shellSort(array, G):
cnt = 0
flag = False
for g in G:
if g != G[-1]:
insertionSort(array, g, cnt, flag)
else:
flag = True
insertionSort(array, g, cnt, flag)
n = int(input())
array = []
for i in range(n):
array.append(int(input()))
G = [4, 1]
p... | Traceback (most recent call last):
File "/tmp/tmpuu22b6xb/tmpzaz_9eah.py", line 14, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s029295348 | p02262 | u605879293 | 1522650738 | Python | Python3 | py | Runtime Error | 1250 | 9832 | 644 | def insertionSort(array, g):
global cnt
n = len(array)
for i in range(g, n):
v = array[i]
j = i - g
while j >= 0 and array[j] > v:
array[j+g] = array[j]
j = j - g
cnt += 1
array[j+g] = v
def shellSort(array, G):
global cnt
cnt = 0... | Traceback (most recent call last):
File "/tmp/tmpww5iy914/tmppy9u1axs.py", line 22, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s689208094 | p02262 | u605879293 | 1522651563 | Python | Python3 | py | Runtime Error | 1340 | 9828 | 618 | def insertionSort(array, g):
global cnt
n = len(array)
for i in range(g, n):
v = array[i]
j = i - g
while j >= 0 and array[j] > v:
array[j+g] = array[j]
j = j - g
cnt += 1
array[j+g] = v
def shellSort(array, G):
global cnt
cnt = 0... | Traceback (most recent call last):
File "/tmp/tmpojr6bby_/tmphukk3din.py", line 21, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s282682400 | p02262 | u605879293 | 1522652043 | Python | Python3 | py | Runtime Error | 1340 | 10628 | 594 | def insertionSort(array, g):
global cnt
n = len(array)
for i in range(g, n):
v = array[i]
j = i - g
while j >= 0 and array[j] > v:
array[j+g] = array[j]
j = j - g
cnt += 1
array[j+g] = v
def shellSort(array, G):
global cnt
cnt = 0... | Traceback (most recent call last):
File "/tmp/tmpbo_6kewr/tmpp7idqnw7.py", line 21, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s173918456 | p02262 | u114315703 | 1523411650 | Python | Python3 | py | Runtime Error | 20 | 5616 | 617 | cnt = 0
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
global cnt
G = [i for i in reversed(range(1, len(A),... | Traceback (most recent call last):
File "/tmp/tmpacff29dl/tmp49864pul.py", line 32, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s395907936 | p02262 | u114315703 | 1523412226 | Python | Python3 | py | Runtime Error | 20 | 5616 | 634 | cnt = 0
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
global cnt
G = [i for i in reversed(range(1, len(A),... | Traceback (most recent call last):
File "/tmp/tmpkpbr7l_h/tmpgfyucmzy.py", line 32, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s160320813 | p02262 | u114315703 | 1523412663 | Python | Python3 | py | Runtime Error | 1320 | 9832 | 656 | cnt = 0
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
global cnt
G = []
v = 1
while v <= len(A):
... | Traceback (most recent call last):
File "/tmp/tmpj7cou36v/tmp837nzp0m.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s754756854 | p02262 | u114315703 | 1523412738 | Python | Python3 | py | Runtime Error | 1270 | 9844 | 686 | cnt = 0
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
global cnt
G = []
v = 1
while v <= len(A):
... | Traceback (most recent call last):
File "/tmp/tmp3g2aynld/tmpytk1ecsf.py", line 38, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s182722236 | p02262 | u114315703 | 1523413382 | Python | Python3 | py | Runtime Error | 1260 | 9832 | 676 | cnt = 0
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
global cnt
G = []
v = 1
while v <= len(A):
... | Traceback (most recent call last):
File "/tmp/tmpf04e3_hr/tmp1h351gic.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s616731861 | p02262 | u114315703 | 1523413564 | Python | Python3 | py | Runtime Error | 1330 | 9832 | 739 | cnt = 0
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
global cnt
G = []
v = 1
while v <= len(A):
... | Traceback (most recent call last):
File "/tmp/tmpu3qced5x/tmp1am5a_ra.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s751245437 | p02262 | u126478680 | 1524955808 | Python | Python3 | py | Runtime Error | 1290 | 11740 | 821 | #! python
# shell_sort.py
import copy
import math
count = 0
def insertion_sort(A, N, g):
global count
A_ = copy.copy(A)
for i in range(g, N):
v = A_[i]
j = i - g
while j >= 0 and A_[j] > v:
A_[j+g] = A_[j]
j = j - g
count += 1
A_[j + g] ... | Traceback (most recent call last):
File "/tmp/tmp0z9245mo/tmpw9ui_jc8.py", line 40, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s010972739 | p02262 | u126478680 | 1524956093 | Python | Python3 | py | Runtime Error | 1450 | 10676 | 744 | #! python
# shell_sort.py
import copy
import math
count = 0
def insertion_sort(A, N, g):
global count
for i in range(g, N):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
count += 1
A[j + g] = v
# h_(i+1) = 3h_i + 1 が... | Traceback (most recent call last):
File "/tmp/tmp76904mnn/tmp5luywjge.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s402149631 | p02262 | u255317651 | 1524968569 | Python | Python3 | py | Runtime Error | 0 | 0 | 719 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
import numpy as np
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
... | Traceback (most recent call last):
File "/tmp/tmp9rceb1ny/tmplji4t3xc.py", line 27, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s682264956 | p02262 | u255317651 | 1524968791 | Python | Python3 | py | Runtime Error | 30 | 5688 | 706 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
import math
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] ... | Traceback (most recent call last):
File "/tmp/tmphmqah41_/tmpmumfx7fm.py", line 27, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s892368019 | p02262 | u255317651 | 1524969135 | Python | Python3 | py | Runtime Error | 20 | 5684 | 706 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
import math
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] ... | Traceback (most recent call last):
File "/tmp/tmpktygwrs9/tmp1ihki_99.py", line 27, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s448862411 | p02262 | u255317651 | 1524969174 | Python | Python3 | py | Runtime Error | 20 | 5688 | 706 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
import math
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] ... | Traceback (most recent call last):
File "/tmp/tmpp7uim4a7/tmp3e858xq9.py", line 27, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s747519235 | p02262 | u255317651 | 1524969364 | Python | Python3 | py | Runtime Error | 4830 | 9916 | 754 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
import math
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] ... | Traceback (most recent call last):
File "/tmp/tmpl67cpaqz/tmpa_oomp1s.py", line 28, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s747492201 | p02262 | u255317651 | 1524972954 | Python | Python3 | py | Runtime Error | 1320 | 9912 | 936 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
import math
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] ... | Traceback (most recent call last):
File "/tmp/tmp8ztdw8cf/tmpqlwzbmlh.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s575628898 | p02262 | u255317651 | 1524973269 | Python | Python3 | py | Runtime Error | 1330 | 9908 | 935 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
import math
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] ... | Traceback (most recent call last):
File "/tmp/tmpsmpa3bqh/tmpzxvpk3_q.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s194509763 | p02262 | u255317651 | 1524973577 | Python | Python3 | py | Runtime Error | 1740 | 9912 | 935 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
import math
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] ... | Traceback (most recent call last):
File "/tmp/tmpi_6lp08o/tmphl86mzwj.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s282649337 | p02262 | u255317651 | 1524974173 | Python | Python3 | py | Runtime Error | 1330 | 9848 | 924 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] = v
... | Traceback (most recent call last):
File "/tmp/tmpe2rsd9c2/tmpf4t67wk4.py", line 35, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s969010616 | p02262 | u255317651 | 1524976972 | Python | Python3 | py | Runtime Error | 1260 | 9848 | 925 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 10:42:20 2018
ALDS1-2d
@author: maezawa
"""
def insertion(a, n, g):
global cnt
for i in range(g, n):
v = a[i]
j = i-g
while j>=0 and a[j]>v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] = v
... | Traceback (most recent call last):
File "/tmp/tmp7hvexoyl/tmpy1sox0er.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s245571074 | p02262 | u126478680 | 1525198411 | Python | Python3 | py | Runtime Error | 1210 | 9904 | 675 | import math
count = 0
m = 0
G = []
def insertion_sort(A, N, g):
global count
for i in range(g, N):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
count += 1
A[j + g] = v
# h_(i+1) = 3h_i + 1 が最良の間隔 (らしい)
def shell_sort... | Traceback (most recent call last):
File "/tmp/tmpp9bd643s/tmpbcncneln.py", line 28, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s873617401 | p02262 | u311299757 | 1525441984 | Python | Python3 | py | Runtime Error | 7380 | 11584 | 687 | from typing import List
def insertion_sort(arr: List[int], n: int, g: int):
cnt = 0
for i in range(g, n):
v = arr[i]
j = i - g
while (j >= 0 and arr[j] > v):
arr[j + g] = arr[j]
j = j - g
cnt += 1
arr[j + g] = v
return cnt
def shell_s... | Traceback (most recent call last):
File "/tmp/tmpal2w2bg7/tmp28rsww4g.py", line 26, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s024981415 | p02262 | u986478725 | 1527429941 | Python | Python3 | py | Runtime Error | 20 | 5608 | 1404 | # ALDS1_2_D.
# シェルソート。
# 理論上、h[i + 1] = h[i] + 1, h[0] = 1という数列が使えて、
# これによると計算量がO(n^1.25)くらいになるとか。
# 挿入ソートを間隔でメソッド化してcntを出力→加算、の流れ。
def show(a):
# 配列の中身を出力する。
_str = ""
for i in range(len(a) - 1):
_str += str(a[i]) + " "
_str += str(a[len(a) - 1])
print(_str)
def insertion_sort(a, g):
... | Traceback (most recent call last):
File "/tmp/tmp_vkygo4u/tmpwhi1hmoq.py", line 50, in <module>
main()
File "/tmp/tmp_vkygo4u/tmpwhi1hmoq.py", line 44, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s268707309 | p02262 | u986478725 | 1527430182 | Python | Python3 | py | Runtime Error | 1700 | 9848 | 1553 | # ALDS1_2_D.
# シェルソート。
# 理論上、h[i + 1] = h[i] + 1, h[0] = 1という数列が使えて、
# これによると計算量がO(n^1.25)くらいになるとか。
# 挿入ソートを間隔でメソッド化してcntを出力→加算、の流れ。
def show(a):
# 配列の中身を出力する。
_str = ""
for i in range(len(a) - 1):
_str += str(a[i]) + " "
_str += str(a[len(a) - 1])
print(_str)
def insertion_sort(a, g):
... | Traceback (most recent call last):
File "/tmp/tmpdeo9cbg_/tmp_9dk93z4.py", line 52, in <module>
main()
File "/tmp/tmpdeo9cbg_/tmp_9dk93z4.py", line 46, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s401090451 | p02262 | u986478725 | 1527431149 | Python | Python3 | py | Runtime Error | 1660 | 9844 | 1553 | # ALDS1_2_D.
# シェルソート。
# 理論上、h[i + 1] = h[i] + 1, h[0] = 1という数列が使えて、
# これによると計算量がO(n^1.25)くらいになるとか。
# 挿入ソートを間隔でメソッド化してcntを出力→加算、の流れ。
def show(a):
# 配列の中身を出力する。
_str = ""
for i in range(len(a) - 1):
_str += str(a[i]) + " "
_str += str(a[len(a) - 1])
print(_str)
def insertion_sort(a, g):
... | Traceback (most recent call last):
File "/tmp/tmpnjift16j/tmpsrsjg1gm.py", line 52, in <module>
main()
File "/tmp/tmpnjift16j/tmpsrsjg1gm.py", line 46, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s866256537 | p02262 | u986478725 | 1527431712 | Python | Python3 | py | Runtime Error | 1340 | 9848 | 1583 | # ALDS1_2_D.
# シェルソート。
# 理論上、h[i + 1] = h[i] + 1, h[0] = 1という数列が使えて、
# これによると計算量がO(n^1.25)くらいになるとか。
# 挿入ソートを間隔でメソッド化してcntを出力→加算、の流れ。
def show(a):
# 配列の中身を出力する。
_str = ""
for i in range(len(a) - 1):
_str += str(a[i]) + " "
_str += str(a[len(a) - 1])
print(_str)
def insertion_sort(a, g):
... | Traceback (most recent call last):
File "/tmp/tmpt2ls8qlj/tmpjvgj1q5c.py", line 55, in <module>
main()
File "/tmp/tmpt2ls8qlj/tmpjvgj1q5c.py", line 49, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s309743382 | p02262 | u986478725 | 1527432086 | Python | Python3 | py | Runtime Error | 0 | 0 | 1674 | # ALDS1_2_D.
# シェルソート。
# 理論上、h[i + 1] = h[i] + 1, h[0] = 1という数列が使えて、
# これによると計算量がO(n^1.25)くらいになるとか。
# 挿入ソートを間隔でメソッド化してcntを出力→加算、の流れ。
def show(a):
# 配列の中身を出力する。
_str = ""
for i in range(len(a) - 1):
_str += str(a[i]) + " "
_str += str(a[len(a) - 1])
print(_str)
def insertion_sort(a, g):
... | File "/tmp/tmphg8k_84r/tmpw09bjpqb.py", line 54
if i > 500000 break
^^^^^
SyntaxError: invalid syntax
| |
s574646912 | p02262 | u986478725 | 1527432124 | Python | Python3 | py | Runtime Error | 1330 | 9844 | 1675 | # ALDS1_2_D.
# シェルソート。
# 理論上、h[i + 1] = h[i] + 1, h[0] = 1という数列が使えて、
# これによると計算量がO(n^1.25)くらいになるとか。
# 挿入ソートを間隔でメソッド化してcntを出力→加算、の流れ。
def show(a):
# 配列の中身を出力する。
_str = ""
for i in range(len(a) - 1):
_str += str(a[i]) + " "
_str += str(a[len(a) - 1])
print(_str)
def insertion_sort(a, g):
... | Traceback (most recent call last):
File "/tmp/tmp5ba7u4ol/tmp2_op4ui2.py", line 57, in <module>
main()
File "/tmp/tmp5ba7u4ol/tmp2_op4ui2.py", line 49, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s277106508 | p02262 | u986478725 | 1527432745 | Python | Python3 | py | Runtime Error | 1260 | 9840 | 1691 | # ALDS1_2_D.
# シェルソート。
# 理論上、h[i + 1] = h[i] + 1, h[0] = 1という数列が使えて、
# これによると計算量がO(n^1.25)くらいになるとか。
# 挿入ソートを間隔でメソッド化してcntを出力→加算、の流れ。
def show(a):
# 配列の中身を出力する。
_str = ""
for i in range(len(a) - 1):
_str += str(a[i]) + " "
_str += str(a[len(a) - 1])
print(_str)
def insertion_sort(a, g):
... | Traceback (most recent call last):
File "/tmp/tmp6yws_3qv/tmp_zlt23xg.py", line 57, in <module>
main()
File "/tmp/tmp6yws_3qv/tmp_zlt23xg.py", line 49, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s400786861 | p02262 | u684241248 | 1527432885 | Python | Python3 | py | Runtime Error | 0 | 0 | 655 | N = int(input())
ary = [int(input()) for _ in range(N)]
def insertion_sort(ary, g):
cnt = 0
for i in range(g, N):
v = ary[i]
j = i - g
while j >= 0 and ary[j] > v:
ary[j + g] = ary[j]
j -= g
cnt += 1
ary[j + g] = v
return cnt
def sh... | Traceback (most recent call last):
File "/tmp/tmpw8_2ie4i/tmph4jn5i0i.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s024684667 | p02262 | u684241248 | 1527432996 | Python | Python3 | py | Runtime Error | 0 | 0 | 687 | N = int(input())
ary = [int(input()) for _ in range(N)]
def insertion_sort(ary, g):
cnt = 0
for i in range(g, N):
v = ary[i]
j = i - g
while j >= 0 and ary[j] > v:
ary[j + g] = ary[j]
j -= g
cnt += 1
ary[j + g] = v
return cnt
def sh... | Traceback (most recent call last):
File "/tmp/tmpgfnpnp9c/tmpvb13y7ke.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s103647827 | p02262 | u303842929 | 1527746771 | Python | Python3 | py | Runtime Error | 0 | 0 | 1413 | #include <iostream>
#include <cstdlib>
#include <vector>
//shellSort(A, n) は、一定の間隔 g だけ離れた要素のみを対象とした挿入ソートである insertionSort(A, n, g) を、最初は大きい値から g を狭めながら繰り返します。これをシェルソートと言います。
//上の疑似コードの ? を埋めてこのプログラムを完成させてください。n と数列 A が与えられるので、疑似コード中の m、m 個の整数 Gi(i=0,1,...,m-1)、入力 Aを昇順にした列を出力するプログラムを作成してください。ただし、出力は以下の条件を満 たす必要があります。
... | File "/tmp/tmprjhsdc1w/tmpu_9ob_in.py", line 4
//shellSort(A, n) は、一定の間隔 g だけ離れた要素のみを対象とした挿入ソートである insertionSort(A, n, g) を、最初は大きい値から g を狭めながら繰り返します。これをシェルソートと言います。
^
SyntaxError: invalid character '、' (U+3001)
| |
s063132333 | p02262 | u682153677 | 1528876894 | Python | Python3 | py | Runtime Error | 0 | 0 | 797 | # -*- coding: utf-8 -*-
def insertionSort(A, n, g):
cnt = 0
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j + g] = A[j]
j = j - g
cnt += 1
A[j + g] = v
print_line(A, cnt)
def shellSort(A, n):
m = 0
G = ... | Traceback (most recent call last):
File "/tmp/tmpbqhxd248/tmpvq0nnzmd.py", line 44, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s057013120 | p02262 | u308033440 | 1528953849 | Python | Python3 | py | Runtime Error | 2560 | 13772 | 716 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = int(A[i])
j = i - g
while j >= 0 and int(A[j]) > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = str(v)
def shellSort(A,n):
global cnt
global G
... | Traceback (most recent call last):
File "/tmp/tmpubrurj9h/tmpbh7vxf3k.py", line 30, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s114017979 | p02262 | u308033440 | 1528953881 | Python | Python3 | py | Runtime Error | 2610 | 13772 | 716 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = int(A[i])
j = i - g
while j >= 0 and int(A[j]) > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = str(v)
def shellSort(A,n):
global cnt
global G
... | Traceback (most recent call last):
File "/tmp/tmp4r237_oh/tmpvv6_faw6.py", line 30, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s843067894 | p02262 | u308033440 | 1528954834 | Python | Python3 | py | Runtime Error | 2520 | 13772 | 758 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = int(A[i])
j = i - g
while j >= 0 and int(A[j]) > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = str(v)
def shellSort(A,n):
global cnt
global G
... | Traceback (most recent call last):
File "/tmp/tmp7u2euzik/tmp1ri8l4i6.py", line 32, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s211672708 | p02262 | u308033440 | 1528954860 | Python | Python3 | py | Runtime Error | 2620 | 13772 | 758 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = int(A[i])
j = i - g
while j >= 0 and int(A[j]) > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = str(v)
def shellSort(A,n):
global cnt
global G
... | Traceback (most recent call last):
File "/tmp/tmpx_2qcd02/tmpotckui19.py", line 32, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s505124495 | p02262 | u308033440 | 1528955177 | Python | Python3 | py | Runtime Error | 1260 | 10632 | 753 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = v
def shellSort(A,n):
global cnt
global G
G = []
cnt... | Traceback (most recent call last):
File "/tmp/tmp9pnw0d7s/tmphju68dxd.py", line 32, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s940886091 | p02262 | u308033440 | 1528955195 | Python | Python3 | py | Runtime Error | 1240 | 10632 | 753 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = v
def shellSort(A,n):
global cnt
global G
G = []
cnt... | Traceback (most recent call last):
File "/tmp/tmpm6nvxrit/tmpgmhj_gj2.py", line 32, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s305093587 | p02262 | u308033440 | 1528955230 | Python | Python3 | py | Runtime Error | 1300 | 10628 | 509 | def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
n = int(input())
A = [int(input()) for i in range(n)]
cnt = 0
G = [1]
for i in range(99):... | Traceback (most recent call last):
File "/tmp/tmp3pytdmse/tmphie73_04.py", line 12, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s485785305 | p02262 | u308033440 | 1528955410 | Python | Python3 | py | Runtime Error | 1330 | 9828 | 521 | n = int(input())
a = []
for i in range(n):
a.append(int(input()))
def insertionsort(a, n, g):
global c
for i in range(g, n):
v = a[i]
j = i - g
while j >= 0 and a[j] > v:
a[j + g] = a[j]
j = j - g
c += 1
a[j + g] = v
c = 0
g = [1]
while... | Traceback (most recent call last):
File "/tmp/tmpsbury2v0/tmpk0cj79hj.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s474200227 | p02262 | u308033440 | 1528955677 | Python | Python3 | py | Runtime Error | 2510 | 13772 | 716 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = int(A[i])
j = i - g
while j >= 0 and int(A[j]) > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = str(v)
def shellSort(A,n):
global cnt
G = []
... | Traceback (most recent call last):
File "/tmp/tmpnkhi6arm/tmp6vli4p1z.py", line 30, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s592275857 | p02262 | u308033440 | 1528955883 | Python | Python3 | py | Runtime Error | 0 | 0 | 772 | ef insert_sort(A, n, g, cnt):
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j -= g
cnt += 1
A[j+g] = v
return cnt
def shellSort(A, n):
cnt = 0
G = []; h = 0
while h <= n:
if 3 * h + 1 <=... | File "/tmp/tmpfbdve2ha/tmp6usa3cqr.py", line 1
ef insert_sort(A, n, g, cnt):
^^^^^^^^^^^
SyntaxError: invalid syntax
| |
s450442407 | p02262 | u657361950 | 1529371266 | Python | Python3 | py | Runtime Error | 0 | 0 | 797 | import sys
def print_arr(arr):
for i in range(len(arr)):
sys.stdout.write(str(arr[i]))
if i != len(arr) - 1:
sys.stdout.write(' ')
print()
def insertion_sort(arr, n, g):
cnt = 0
for i in range(g, n):
v = arr[i]
j = i - g
while j >= 0 and arr[j] > v:
arr[j + g] = arr[j]
j = j - g
cnt += 1
a... | Traceback (most recent call last):
File "/tmp/tmplbqs72as/tmpr8jhxk8x.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s498251412 | p02262 | u424720817 | 1529387688 | Python | Python3 | py | Runtime Error | 0 | 0 | 774 | def main():
n = int(input())
numbers = [int(input()) for i in range(n)]
count = shellSort(numbers, n)
print(count)
[print(i) for i in numbers]
def shellSort(numbers, n):
count = 0
m = 1
g = []
while m <= n :
g.append(m)
m = 3 * m + 1
for i in range(len(g), -1, ... | Traceback (most recent call last):
File "/tmp/tmpidelkcdf/tmp8tpytp4n.py", line 40, in <module>
main()
File "/tmp/tmpidelkcdf/tmp8tpytp4n.py", line 2, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s127440653 | p02262 | u298224238 | 1529471776 | Python | Python3 | py | Runtime Error | 0 | 0 | 645 | def insertionSort(arr, g):
cnt = 0
for i in range(g, len(arr)):
tmp = arr[i]
j = i - g
while(j >= 0 and arr[j] > tmp):
arr[j + g] = arr[j]
j -= g
cnt += 1
arr[j + 1] = tmp
return cnt
def shellSort(arr):
cnt = 0
g = []
h = 0
... | File "/tmp/tmp_7h40940/tmpywq7ycgp.py", line 23
cnt += insertionSort(a, g[i]):
^
SyntaxError: invalid syntax
| |
s156411519 | p02262 | u298224238 | 1529471816 | Python | Python3 | py | Runtime Error | 0 | 0 | 647 | def insertionSort(arr, g):
cnt = 0
for i in range(g, len(arr)):
tmp = arr[i]
j = i - g
while(j >= 0 and arr[j] > tmp):
arr[j + g] = arr[j]
j -= g
cnt += 1
arr[j + 1] = tmp
return cnt
def shellSort(arr):
cnt = 0
g = []
h = 0
... | File "/tmp/tmpi6t_t_gr/tmp1w75ibu4.py", line 23
cnt += insertionSort(arr, g[i]):
^
SyntaxError: invalid syntax
| |
s232371759 | p02262 | u298224238 | 1529471901 | Python | Python3 | py | Runtime Error | 0 | 0 | 662 | def insertionSort(arr, g):
cnt = 0
for i in range(g, len(arr)):
tmp = arr[i]
j = i - g
while(j >= 0 and arr[j] > tmp):
arr[j + g] = arr[j]
j -= g
cnt += 1
arr[j + 1] = tmp
return cnt
def shellSort(arr):
cnt = 0
g = []
h = 0
... | Traceback (most recent call last):
File "/tmp/tmpxc2u1u5t/tmpc6yeavpy.py", line 28, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s934196965 | p02262 | u298224238 | 1529471936 | Python | Python3 | py | Runtime Error | 0 | 0 | 664 | def insertionSort(arr, g):
cnt = 0
for i in range(g, len(arr)):
tmp = arr[i]
j = i - g
while(j >= 0 and arr[j] > tmp):
arr[j + g] = arr[j]
j -= g
cnt += 1
arr[j + 1] = tmp
return cnt
def shellSort(arr):
cnt = 0
g = []
h = 0
... | Traceback (most recent call last):
File "/tmp/tmpiklkw874/tmpu1k6hpjh.py", line 28, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s869940665 | p02262 | u298224238 | 1529472627 | Python | Python3 | py | Runtime Error | 0 | 0 | 663 | def insertionSort(arr, N, g):
cnt = 0
for i in range(g, N):
tmp = arr[i]
j = i - g
while(j >= 0 and arr[j] > tmp):
arr[j + g] = arr[j]
j -= g
cnt += 1
arr[j + g] = tmp
return cnt
def shellSort(arr, N):
cnt = 0
G = []
h = 0
... | Traceback (most recent call last):
File "/tmp/tmpq_1paxvv/tmp9xmdka6r.py", line 29, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s676859517 | p02262 | u298224238 | 1529473395 | Python | Python3 | py | Runtime Error | 0 | 0 | 615 | cnt = 0
def insertionSort(arr, N, g):
for i in range(g, N):
tmp = arr[i]
j = i - g
while(j >= 0 and arr[j] > tmp):
arr[j + g] = arr[j]
j -= g
cnt += 1
arr[j + g] = tmp
def shellSort(arr, N):
G = []
h = 0
m = 0
while h <= N / 9:
... | Traceback (most recent call last):
File "/tmp/tmp5b8ocrg_/tmppwx32166.py", line 29, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s273263706 | p02262 | u308033440 | 1529641655 | Python | Python3 | py | Runtime Error | 2540 | 13648 | 727 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = int(A[i])
j = i - g
while j >= 0 and int(A[j]) > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = str(v)
def shellSort(A,n):
global cnt
global G
... | Traceback (most recent call last):
File "/tmp/tmpgu_j444_/tmpjob71ljo.py", line 31, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s470441814 | p02262 | u308033440 | 1529641655 | Python | Python3 | py | Runtime Error | 2600 | 13648 | 727 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = int(A[i])
j = i - g
while j >= 0 and int(A[j]) > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = str(v)
def shellSort(A,n):
global cnt
global G
... | Traceback (most recent call last):
File "/tmp/tmppgs1tbef/tmpvfdlil6c.py", line 31, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s071337637 | p02262 | u308033440 | 1529641697 | Python | Python3 | py | Runtime Error | 2590 | 13648 | 727 | def insertionSort(A,n,g):
for i in range(g,n,1):
v = int(A[i])
j = i - g
while j >= 0 and int(A[j]) > v:
global cnt
A[j + g] = A[j]
j = j - g
cnt = cnt + 1
A[j+g] = str(v)
def shellSort(A,n):
global cnt
global G
... | Traceback (most recent call last):
File "/tmp/tmp9gorgye_/tmpoqck947q.py", line 31, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s777127399 | p02262 | u285980122 | 1529642314 | Python | Python3 | py | Runtime Error | 20 | 5612 | 704 | def insertionSort(A, n, g):
global cnt
for i in range(g,n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt+=1
A[j+g] = v
def shellSort(A, n):
global cnt
cnt = 0
g = 2
m = n // g
print(m) # 1行目
... | Traceback (most recent call last):
File "/tmp/tmpshza0hqa/tmphftobzan.py", line 30, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s564464872 | p02262 | u153665391 | 1529822074 | Python | Python3 | py | Runtime Error | 20 | 5604 | 784 | N = int(input())
A = [int(input()) for i in range(N)]
def insertion_sort(A, N, diff, cnt):
for i in range(diff, N):
tmp_num = A[i]
j = i - diff
while j >= 0 and A[j] > tmp_num:
A[j+diff] = A[j]
j = j - diff
cnt += 1
A[j+diff] = tmp_num
return ... | Traceback (most recent call last):
File "/tmp/tmpmk6er2p_/tmpx9ll3in_.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s147559661 | p02262 | u316584871 | 1530182921 | Python | Python3 | py | Runtime Error | 8280 | 9836 | 919 | def insertionSort(A, n, g):
cnti = 0
for i in range(g, n):
v = A[i]
j = i-g
while (j >= 0 and A[j] > v):
A[j + g] = A[j]
j -= g
cnti += 1
A[j+g] = v
return cnti
def shellSort(A,n):
cnt = 0
G = []
for k in range(int((n/3)) +1):
... | Traceback (most recent call last):
File "/tmp/tmphg4ewfmg/tmp6j13rsy9.py", line 35, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s298878277 | p02262 | u285980122 | 1530246902 | Python | Python3 | py | Runtime Error | 20 | 5608 | 1067 | def insertionSort(A, n, g):
global cnt
for i in range(g,n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt+=1
A[j+g] = v
def shellSort(A, n):
global cnt
cnt = 0
#g = 3
#g = n // 2 * 2
g = 2
... | Traceback (most recent call last):
File "/tmp/tmpnh22efkk/tmpm27p8ae1.py", line 44, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s221766270 | p02262 | u285980122 | 1530247004 | Python | Python3 | py | Runtime Error | 1720 | 9832 | 1077 | def insertionSort(A, n, g):
global cnt
for i in range(g,n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt+=1
A[j+g] = v
def shellSort(A, n):
global cnt
cnt = 0
#g = 3
#g = n // 2 * 2
g = 2
... | Traceback (most recent call last):
File "/tmp/tmp96tbt6q5/tmp7cbj_e9l.py", line 45, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s641962174 | p02262 | u285980122 | 1530247079 | Python | Python3 | py | Runtime Error | 1680 | 9832 | 1077 | def insertionSort(A, n, g):
global cnt
for i in range(g,n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt+=1
A[j+g] = v
def shellSort(A, n):
global cnt
cnt = 0
#g = 3
#g = n // 2 * 2
g = 2
... | Traceback (most recent call last):
File "/tmp/tmpov71wg16/tmphwmtpact.py", line 45, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s273711766 | p02262 | u285980122 | 1530247450 | Python | Python3 | py | Runtime Error | 1920 | 9836 | 790 | def insertionSort(A, n, g):
global cnt
for i in range(g,n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt+=1
A[j+g] = v
def shellSort(A, n):
global cnt
cnt = 0
g = 4
G = [1]
m = 1
for i in ... | Traceback (most recent call last):
File "/tmp/tmp_3zqggws/tmpznl4che0.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s678255532 | p02262 | u285980122 | 1530247936 | Python | Python3 | py | Runtime Error | 3340 | 9832 | 815 | def insertionSort(A, n, g):
global cnt
for i in range(g,n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt+=1
A[j+g] = v
def shellSort(A, n):
global cnt
cnt = 0
g = 1
G = [1]
m = 1
for i in ... | Traceback (most recent call last):
File "/tmp/tmpsa1xidi2/tmpht095tzl.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s619368441 | p02262 | u285980122 | 1530248115 | Python | Python3 | py | Runtime Error | 4030 | 9836 | 833 | def insertionSort(A, n, g):
global cnt
for i in range(g,n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt+=1
A[j+g] = v
def shellSort(A, n):
global cnt
cnt = 0
g = 1
G = [0]
m = 1
for i in ... | Traceback (most recent call last):
File "/tmp/tmpy71aikxw/tmpnn10mfyp.py", line 38, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s486198095 | p02262 | u285980122 | 1530248253 | Python | Python3 | py | Runtime Error | 4340 | 9840 | 832 | def insertionSort(A, n, g):
global cnt
for i in range(g,n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt+=1
A[j+g] = v
def shellSort(A, n):
global cnt
cnt = 0
g = 1
G = [1]
m = 1
for i in ... | Traceback (most recent call last):
File "/tmp/tmp61daj0xq/tmp3exqcobs.py", line 38, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s095683071 | p02262 | u320121447 | 1530509461 | Python | Python3 | py | Runtime Error | 4840 | 9828 | 683 | def swap(A, i, j):
tmp = A[i]
A[i] = A[j]
A[j] = tmp
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
... | Traceback (most recent call last):
File "/tmp/tmpjnlya0sq/tmp5153rjtf.py", line 31, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s050083403 | p02262 | u320121447 | 1530509591 | Python | Python3 | py | Runtime Error | 1270 | 9836 | 703 | def swap(A, i, j):
tmp = A[i]
A[i] = A[j]
A[j] = tmp
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
... | Traceback (most recent call last):
File "/tmp/tmpbpc1pwwg/tmpg4cwybxz.py", line 32, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s093373899 | p02262 | u320121447 | 1530509815 | Python | Python3 | py | Runtime Error | 1330 | 9836 | 739 | def swap(A, i, j):
tmp = A[i]
A[i] = A[j]
A[j] = tmp
def insertionSort(A, n, g):
global cnt
for i in range(g, n):
v = A[i]
j = i - g
while j >= 0 and A[j] > v:
A[j+g] = A[j]
j = j - g
cnt += 1
A[j+g] = v
def shellSort(A, n):
... | Traceback (most recent call last):
File "/tmp/tmpdi86f62_/tmpgy8t41h9.py", line 33, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s074260882 | p02262 | u677291728 | 1530605968 | Python | Python3 | py | Runtime Error | 0 | 0 | 599 | #! /usr/bin/python
import sys
if sys.version_info[0] >= 3: raw_input = input
def insertion_sort(a,g):
global cnt
for i in range(g, len(a)):
v = a[i]
j = i - g
while j >= 0 and a[j] > v:
a[j+g] = a[j]
j = j - g
cnt += 1
a[j+g] = v
def shell_sort(a):
global cnt
cnt = 0
g = ... | Traceback (most recent call last):
File "/tmp/tmpd401vb0b/tmpq33sbh1i.py", line 31, in <module>
a = [int(raw_input()) for i in range(raw_input())]
^^^^^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.