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
s311306409
p02262
u567380442
1421320249
Python
Python3
py
Runtime Error
19920
47312
604
import sys 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 = [] ...
s469556105
p02262
u567380442
1421323371
Python
Python3
py
Runtime Error
19930
47312
645
import sys 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 = [] ...
s649028204
p02262
u567380442
1421323541
Python
Python3
py
Runtime Error
19920
47312
684
import sys def isort(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 -= g cnt += 1 a[j + g] = v # input data n = int(sys.stdin.readline()) a = [] for i in range(n): a.append(i...
s301062679
p02262
u567380442
1421323944
Python
Python3
py
Runtime Error
19930
47312
661
#!/usr/bin/python import sys if sys.version_info[0]>=3: raw_input=input 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...
s382301594
p02262
u567380442
1426472267
Python
Python3
py
Runtime Error
19930
159368
607
import sys def shell(a): g = [] h = 1 while h <= len(a): g.append(h) h = 3*h+1 g.reverse() print(len(g)) print(*g) for i in g: insertion(a, i) def insertion(a, g): global cnt for i in range(g, len(a)): v = a[i] i -= g while i >= 0 an...
s625882885
p02262
u567380442
1426473286
Python
Python3
py
Runtime Error
19930
47080
441
import sys n = int(sys.stdin.readline()) a = list(map(int,sys.stdin)) g = [] h = 1 while h <= n: g.append(h) h = 3 * h + 1 g.reverse() cnt = 0 for gi in g: for i in range(gi, n): v = a[i] i -= gi while i >= 0 and a[i] > v: a[i + gi] = a[i] i -= gi ...
s180232281
p02262
u567380442
1426473549
Python
Python3
py
Runtime Error
19920
47064
439
import sys n = int(sys.stdin.readline()) a = list(map(int,sys.stdin)) g = [] h = 1 while h <= n: g.append(h) h = 3 * h + 1 g.reverse() cnt = 0 for gi in g: for i in range(gi, n): v = a[i] i -= gi while i >= 0 and a[i] > v: a[i + gi] = a[i] i -= gi ...
s830259494
p02262
u567380442
1428925820
Python
Python3
py
Runtime Error
19930
47076
509
from sys import stdin def main(): n = int(stdin.readline()) a = list(map(int, stdin)) g = [] h = 1 while h <= n: g.append(h) h = 3 * h + 1 g.reverse() cnt = 0 for gi in g: for i in range(gi, n): v = a[i] i -= gi while i >= 0...
s933324342
p02262
u567380442
1428926841
Python
Python3
py
Runtime Error
19930
159360
562
from sys import stdin def main(): n = int(stdin.readline()) a = list(map(int, stdin.readlines())) g = [] h = 1 while h <= n: g.append(h) h = 3 * h + 1 g.reverse() cnt = 0 for gi in g: for i in range(gi, n): v = a[i] i -= gi ...
s842454433
p02262
u604774382
1432852011
Python
Python3
py
Runtime Error
19930
47312
671
def insertionSort( nums, n, g ): cnt = 0 for i in range( g, len( nums ) ): v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v return cnt def shellSort( nums, n ): cnt = 0 g = [] val =0 for i in range( 0, n )...
s865813296
p02262
u604774382
1432888469
Python
Python3
py
Runtime Error
19920
47308
732
def insertionSort( nums, n, g ): cnt = 0 for i in range( g, len( nums ) ): v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v return cnt def shellSort( nums, n ): cnt = 0 g = [] val =0 for i in range( 0, n ): val = 3*val+1 if n < va...
s562278661
p02262
u604774382
1432888843
Python
Python3
py
Runtime Error
19930
47308
658
def insertionSort( nums, n, g ): cnt = 0 i = g n = len( nums ) while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt def shellSort( nums, n ): cnt = 0 g = [] val =0 for i in range( 0, n ): val = 3*val+1 ...
s562863397
p02262
u604774382
1432889935
Python
Python
py
Runtime Error
19930
67900
678
def insertionSort( nums, n, g ): cnt = 0 i = g n = len( nums ) while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j] and j+g < n: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt def shellSort( nums, n ): cnt = 0 g = [] val =0 for i in range( 0, n ): va...
s691818280
p02262
u604774382
1432890677
Python
Python3
py
Runtime Error
19920
47316
651
def insertionSort( nums, n, g ): cnt = 0 i = g while i < len( nums ): v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt def shellSort( nums, n ): cnt = 0 g = [] val =0 for i in range( 0, n ): val = 3*val+1 if n...
s881056403
p02262
u604774382
1432892811
Python
Python3
py
Runtime Error
19930
47308
645
def insertionSort( nums, g ): c = 0 i = g n = len( nums ) while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g c += 1 nums[ j+g ] = v i += 1 return c def shellSort( nums, n ): cnt = 0 g = [] val =0 for i in range( 0, n ): val = 3*val+1 if n < v...
s680264929
p02262
u604774382
1432899624
Python
Python3
py
Runtime Error
19930
47308
648
def insertionSort( nums, n, g ): cnt = 0 i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt def shellSort( nums, n ): cnt = 0 g = [] val =0 for i in range( n ): val = 3*val+1 if n < val: break...
s345866675
p02262
u604774382
1432899747
Python
Python3
py
Runtime Error
0
0
599
def insertionSort( nums, n, g ): cnt = 0 i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt n = int( input( ) ) nums = [] for i in range( 0, n ): nums.append( int( input( ) ) ) cnt = 0 g = [] val =0 for...
s266994714
p02262
u604774382
1432899828
Python
Python3
py
Runtime Error
19930
47312
578
def insertionSort( nums, n, g ): cnt = 0 i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt n = int( input( ) ) nums = [] for i in range( 0, n ): nums.append( int( input( ) ) ) cnt = 0 g = [] val =0 for...
s976589776
p02262
u604774382
1432900033
Python
Python3
py
Runtime Error
19930
47312
585
def insertionSort( nums, n, g ): cnt = 0 i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt n = int( input( ) ) nums = [] for i in range( 0, n ): nums.append( int( input( ) ) ) cnt = 0 g = [] val = 0 fo...
s952109540
p02262
u604774382
1432900448
Python
Python3
py
Runtime Error
19930
47308
646
def insertionSort( nums, n, g ): global cnt i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 def shellSort( nums, n ): global cnt g = [] val =0 for i in range( 0, n ): val = 3*val+1 if n < val: break ...
s794502674
p02262
u604774382
1432900642
Python
Python3
py
Runtime Error
19930
47312
625
def insertionSort( nums, n, g ): global cnt i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 def shellSort( nums, n ): g = [] val =0 for i in range( n ): val = 3*val+1 if n < val: break g.append( val...
s430191413
p02262
u604774382
1432900731
Python
Python
py
Runtime Error
19920
104012
663
import sys def insertionSort( nums, n, g ): global cnt i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 def shellSort( nums, n ): g = [] val =0 for i in range( n ): val = 3*val+1 if n < val: break g...
s770338993
p02262
u604774382
1432900960
Python
Python3
py
Runtime Error
19920
47308
681
import sys def insertionSort( nums, n, g ): cnt = 0 i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt def shellSort( nums, n ): g = [] val =0 for i in range( n ): val = 3*val+1 if n < val: ...
s472069640
p02262
u604774382
1432901695
Python
Python3
py
Runtime Error
19930
47308
653
import sys def insertionSort( nums, n, g ): cnt = 0 i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 return cnt def shellSort( nums, n ): g = [] val = 1 while val <= n: g.append( val ) val = 3*val+1 g...
s562124570
p02262
u604774382
1432902097
Python
Python3
py
Runtime Error
19930
47308
635
import sys def insertionSort( nums, n, g ): global cnt i = g while i < n: v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v i += 1 def shellSort( nums, n ): g = [] val = 1 while val <= n: g.append( val ) val = 3*val+1 g.reverse(...
s963226480
p02262
u604774382
1432902366
Python
Python3
py
Runtime Error
19930
47304
592
def insertionSort( nums, n, g ): global cnt for i in range( g, n ): v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums, n ): g = [] val = 1 while val <= n: g.append( val ) val = 3*val+1 g.reverse( ) m = len( g ) ...
s875646735
p02262
u604774382
1432903288
Python
Python3
py
Runtime Error
19930
47308
527
def insertionSort( nums, n, g ): global cnt for i in range( g, n ): v = nums[i] j = i - g while 0 <= j and v < nums[j]: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v n = int( input( ) ) nums = [] for i in range( n ): nums.append( int( input( ) ) ) g = [] val = 1 while val <= n: g.append...
s116600536
p02262
u604774382
1432903566
Python
Python3
py
Runtime Error
19930
47308
462
n = int( input( ) ) nums = [] for i in range( n ): nums.append( int( input( ) ) ) g = [] val = 1 while val <= n: g.append( val ) val = 3*val+1 g.reverse( ) m = len( g ) print( m ) print( " ".join( map( str, g ) ) ) cnt = 0 for i in range( m ): for k in range( g[i], n ): v = nums[k] j = k - g[i] while 0 <= j ...
s102693747
p02262
u604774382
1432904431
Python
Python3
py
Runtime Error
19930
47308
463
n = int( input( ) ) nums = [] for i in range( n ): nums.append( int( input( ) ) ) g = [] val = 1 while val <= n: g.append( val ) val = 3*val+1 g.reverse( ) m = len( g ) print( m ) print( " ".join( map( str, g ) ) ) cnt = 0 for i in range( m ): for k in range( g[i], n ): v = nums[k] j = k - g[i] while 0 <= j ...
s886364943
p02262
u604774382
1432904812
Python
Python3
py
Runtime Error
19930
47308
462
n = int( input( ) ) nums = [] for i in range( n ): nums.append( int( input( ) ) ) g = [] val = 1 while val <= n: g.append( val ) val = 3*val+1 g.reverse( ) m = len( g ) print( m ) print( " ".join( map( str, g ) ) ) cnt = 0 for i in range( m ): for k in range( g[i], n ): v = nums[k] j = k - g[i] while 0 <= j ...
s275931454
p02262
u604774382
1432906431
Python
Python3
py
Runtime Error
19930
47308
596
def insertionSort( nums, n, g ): cnt = 0 for i in range( g, n): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v return cnt def shellSort( nums, n ): cnt = 0 g = [] v = 1 while v <= n: g.append( v ) v = 3*v+1 g.reverse...
s303705193
p02262
u604774382
1432906534
Python
Python3
py
Runtime Error
19920
47308
593
def insertionSort( nums, n, g ): global cnt for i in range( g, n): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums, n ): global cnt cnt = 0 g = [] v = 1 while v <= n: g.append( v ) v = 3*v+1 g.reve...
s069915323
p02262
u604774382
1432906630
Python
Python3
py
Runtime Error
19920
47308
577
def insertionSort( nums, n, g ): global cnt for i in range( g, n): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums, n ): g = [] v = 1 while v <= n: g.append( v ) v = 3*v+1 g.reverse( ) m = len( g ) ...
s905599356
p02262
u604774382
1432907108
Python
Python3
py
Runtime Error
19930
47308
560
def insertionSort( nums, n, g ): global cnt for i in range( g, n): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums, n ): g = [] v = 1 while v <= n: g.append( v ) v = 3*v+1 g.reverse( ) m = len( g ) ...
s053727443
p02262
u604774382
1432907375
Python
Python3
py
Runtime Error
19930
47308
572
def insertionSort( nums, n, g ): global cnt for i in range( g, n ): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums ): g = [] v = 1 n = len( nums ) while v <= n: g.append( v ) v = 3*v+1 g.reverse( )...
s175827468
p02262
u604774382
1432953157
Python
Python3
py
Runtime Error
19920
47308
604
def insertionSort( nums, n, g ): cnt = 0 for i in range( g, n ): v = nums[i] j = i - g while j >= 0 and nums[j] > v: nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v return cnt def shellSort( nums, n ): g = [] v = 1 while v <= n: g.append( v ) v = 3*v+1 g.reverse( ) m = len(...
s129170470
p02262
u604774382
1433166438
Python
Python3
py
Runtime Error
0
0
706
def insertionSort( nums, n, g ): global cnt for i in range( g, n ): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums ): global cnt g = [] v ...
s589646206
p02262
u604774382
1433166545
Python
Python3
py
Runtime Error
0
0
593
def insertionSort( nums, n, g ): global cnt for i in range( g, n ): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums ): global cnt g = [] v = 1 n = len( nums ) while v <= n: g.append( v ) v = 3*v+1 g....
s185398917
p02262
u604774382
1433166582
Python
Python3
py
Runtime Error
19930
47308
585
def insertionSort( nums, n, g ): global cnt for i in range( g, n ): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums ): global cnt g = [] v = 1 n = len( nums ) while v <= n: g.append( v ) v = 3*v+1 g....
s170738802
p02262
u604774382
1435153212
Python
Python3
py
Runtime Error
19930
47308
714
def insertionSort( nums, n, g ): global cnt for i in range( g, n ): v = nums[i] j = i - g while ( 0 <= j ) and ( v < nums[j] ): nums[ j+g ] = nums[j] j -= g cnt += 1 nums[ j+g ] = v def shellSort( nums ): global cnt g = [] v = 1 ...
s613362394
p02262
u604774382
1435154426
Python
Python3
py
Runtime Error
19930
47316
677
def insertionSort( s, n, g ): global cnt for i in range( g, n ): v = s[i] j = i - g while ( 0 <= j ) and ( v < s[j] ): s[ j+g ] = s[j] j -= g cnt += 1 s[ j+g ] = v def shellSort( s ): global cnt g = [] v = 1 n = len( s ) ...
s662116855
p02262
u609407244
1436244293
Python
Python3
py
Runtime Error
30
6776
839
def insertion_sort(array, g, result): for i in range(g, len(array)): v = array[i] j = i - g while j >= 0 and array[j] > v: array[j + g] = array[j] j -= g result['count'] += 1 A[j + g] = v def shell_sort(array, result): result['count'] = 0 ...
s645349975
p02262
u609407244
1436244625
Python
Python3
py
Runtime Error
19930
47320
922
def insertion_sort(array, g, result): for i in range(g, len(array)): v = array[i] j = i - g while j >= 0 and array[j] > v: array[j + g] = array[j] j -= g result['count'] += 1 A[j + g] = v def g_gene(n): yield 1 for i in range(2, n): ...
s235567975
p02262
u609407244
1436245310
Python
Python3
py
Runtime Error
19930
47324
934
def insertion_sort(array, g, result): for i in range(g, len(array)): v = array[i] j = i - g while j >= 0 and array[j] > v: array[j + g] = array[j] j -= g result['count'] += 1 A[j + g] = v def g_gene(n): yield 1 i = 2 while 1: ...
s687748137
p02262
u609407244
1436245917
Python
Python3
py
Runtime Error
19930
47316
921
def insertion_sort(array, g, result): for i in range(g, len(array)): v = array[i] j = i - g while j >= 0 and array[j] > v: array[j + g] = array[j] j -= g result['count'] += 1 A[j + g] = v def g_gene(n): yield 1 for i in range(2, n): ...
s040837384
p02262
u609407244
1436258459
Python
Python3
py
Runtime Error
19930
47316
945
def insertion_sort(array, g, result): for i in range(g, len(array)): v = array[i] j = i - g while j >= 0 and array[j] > v: array[j + g] = array[j] j -= g result['count'] += 1 A[j + g] = v def g_gene(n): yield 1 for i in range(2, n): ...
s600989786
p02262
u609407244
1436258595
Python
Python3
py
Runtime Error
19920
47320
986
def insertion_sort(array, g, result): for i in range(g, len(array)): v = array[i] j = i - g while j >= 0 and array[j] > v: array[j + g] = array[j] j -= g result['count'] += 1 A[j + g] = v def g_gene(n): yield 1 for i in range(2, n): ...
s171963275
p02262
u609407244
1436258655
Python
Python3
py
Runtime Error
19930
47328
805
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 import sys def isort(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 -= g ...
s074009144
p02262
u609407244
1436258790
Python
Python3
py
Runtime Error
19930
47308
690
import sys def isort(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 -= g cnt += 1 a[j + g] = v # input data n = int(sys.stdin.readline()) a = [] for i in range(n): a.append...
s342355935
p02262
u609407244
1436259320
Python
Python3
py
Runtime Error
19920
47308
661
#!/usr/bin/python import sys if sys.version_info[0]>=3: raw_input=input 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...
s389857045
p02262
u197445199
1442297636
Python
Python
py
Runtime Error
0
0
536
import math N = int(raw_input()) A = [] for i in range(N): a = raw_input() A.append(int(a)) g_pre_list = [1093, 364, 121, 40, 13, 4, 1] g_list = [] for g in g_pre_list: if g < math.ceil((N**1.5): g_list.append(g) print len(g_list) print " ".join(map(str, g_list)) count = 0 for g in g_list: for...
s729311605
p02262
u072053884
1444715383
Python
Python3
py
Runtime Error
0
0
392
n = int(input()) A = [int(input()) for i in range(n)] #shellSort cnt = 0 m = 3 G = [n - 1,int((n - 1) / 2) 1] for i in range(m): g = G[i] # insertionSort for j in range(g, n): k = j - g while (k >= 0) and (A[k] > A[k + g]): A[k + g], A[k] = A[k], A[k + g] k -= g ...
s381492220
p02262
u072053884
1444757778
Python
Python3
py
Runtime Error
0
0
472
import sys A = list(map(int, sys.stdin.read().split("\n"))) n = A[0] del A[0] #shellSort cnt = 0 G = [] tg = 1 while tg <= n: G.append(tg) tg = 3 * tg + 1 G.reverse() m = len(G) for i in range(m): g = G[i] # insertionSort for j in range(g, n): k = j - g while (k >= 0) and (A[k] ...
s698680901
p02262
u963402991
1448344505
Python
Python3
py
Runtime Error
0
0
719
def insertionSort(A, n, g): global count for i in range(g,n): v = A[i] j = i - g #間隔gずつ選択ソートを行っていく while j >= 0 and A[j] > v: A[j+g] = A[j] j -= g count += 1 A[j+g] = v def shellSort(A, n): global count G = [i for i in range(1,...
s900180595
p02262
u963402991
1448344672
Python
Python3
py
Runtime Error
0
0
587
n = int(input()) A = [int(input()) for i in range(n)] count = 0 def insertionSort(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 -= g count += 1 A[j+g] = v def shellSort(A, ...
s234316657
p02262
u488601719
1448782155
Python
Python3
py
Runtime Error
0
0
587
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 g = [] h = 1 while h <= len(a): ...
s161838952
p02262
u488601719
1448782942
Python
Python3
py
Runtime Error
0
0
672
import math def insertion_sort(A, N, g): for i in range(g, N): v = A[i] j = i - g while j >= 0 and A[j] > v: # v????????§???????????°??????????????? A[j+g] = A[j] j -= g A[j+g] = v print(*A) def shell_sort(a, n): g = [] gap = 1 ...
s160383556
p02262
u341533698
1454397620
Python
Python
py
Runtime Error
0
0
823
def insertionSort(A, n, g, cnt): for i in xrange(1,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 return A, cnt def shellSort(A, n): cnt = 0 G = [1] for i in range(1,len(A)): i...
s390211766
p02262
u603356762
1464872680
Python
Python3
py
Runtime Error
0
0
377
N = int(input()) a = [int(x) for x in input().split()] 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 return A def shellSort(A,n): m = 3 G = [4,3,1] for x in G: A=insertionSort(A,n,x) p...
s406578243
p02262
u603356762
1464873155
Python
Python3
py
Runtime Error
0
0
390
N = int(input()) a = [int(x) for x in input().split()] 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 return A def shellSort(A,n): m = 3 G = [4,3,1] for x in G: A=insertionSort(A,n,x) p...
s270295337
p02262
u603356762
1464873371
Python
Python3
py
Runtime Error
0
0
388
N = int(input()) a = [int(x) for x in input().split()] 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 return A def shellSort(A,n): m = 2 G = [4,1] for x in G: A=insertionSort(A,n,x) pri...
s766841792
p02262
u496045719
1470301086
Python
Python3
py
Runtime Error
0
0
935
swap_count = 0 def main(): num = int(input()) elements = [int(x) for x in input().split()] # Get max interval intervals = [] for i in range(0, num): interval = int_f(i) if num <= interval: break intervals.append(interval) for interval in intervals: insertion_sort(elements, num, int...
s542610658
p02262
u496045719
1470303785
Python
Python3
py
Runtime Error
0
0
925
swap_count = 0 def main(): num = int(input()) elements = [] for i in range(0, num): elements.append(int(input())) # Get intervals interval = 1 intervals = [interval] while True: interval = int_f(interval) if interval > num: break intervals.insert(0, interval) for interval in in...
s716129733
p02262
u092047183
1471654376
Python
Python3
py
Runtime Error
0
0
555
# coding: utf-8 import math import sys def insertionSort(a, n, g): ct = 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 ct += 1 a[j+g] = v return ct n = int(input()) a = list(map(int, sys...
s927291260
p02262
u390995924
1472577791
Python
Python3
py
Runtime Error
0
0
600
n = int(input()) A = [int(input()) for _ in range(n)] def isort(n, g): global A 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 -= g cnt += 1 A[j + g] = v def ssort(n): global cnt g...
s099344903
p02262
u890722286
1474035320
Python
Python3
py
Runtime Error
0
0
561
import sys n = int(input()) A = list(map(int, sys.stdin)) cnt = 0 def insertion_sort(L, n, g): global cnt for i in range(g, n): v = L[i] j = i - g while 0 <= j and v < L[j]: L[j+g] = L[j] j -= g cnt += 1 L[j+g] = v def shell_sort(L, n): ...
s940024150
p02262
u890722286
1474035524
Python
Python3
py
Runtime Error
0
0
683
import sys n = int(input()) A = list(map(int, sys.stdin)) cnt = 0 def insertion_sort(L, n, g): global cnt for i in range(g, n): v = L[i] j = i - g while 0 <= j and v < L[j]: L[j+g] = L[j] j -= g cnt += 1 L[j+g] = v def shell_sort(L, n): ...
s552826873
p02262
u908984540
1474841100
Python
Python3
py
Runtime Error
0
0
698
# -*- coding:utf-8 -*- cnt = 0 def insection_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 -= g cnt += 1 a[j+g] = v def shell_sort(a): g = list(1) temp = 4 while te...
s236822698
p02262
u500396695
1477009105
Python
Python3
py
Runtime Error
0
0
791
import math def insertionsort(A, n, 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 cnt += 1 A[j + g] = v return cnt def shellsort(A, n): G = [] ##??§????°???¨?????????????????°?...
s754001482
p02262
u922871577
1478938272
Python
Python
py
Runtime Error
10
6408
529
cnt = 0 def insSort(A, n, g): global cnt for i in xrange(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 = range(n-1, 0, -3) if G[-1] != 1: G.append(1) m ...
s677846266
p02262
u922871577
1478939940
Python
Python
py
Runtime Error
0
0
575
cnt = 0 def insSort(A, n, g): global cnt for i in xrange(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 = reversed([i*i for i in xrange(1, n) if i*i < n]) if len(G) ...
s226666477
p02262
u908984540
1482770429
Python
Python3
py
Runtime Error
30
7824
1018
# -*- coding:utf-8 -*- import math def insertion_sort(num_list, length, interval): cnt = 0 for i in range(interval, length): v = num_list[i] j = i - interval while j >= 0 and num_list[j] > v: num_list[j+interval] = num_list[j] j = j - interval cnt = ...
s326998040
p02262
u089830331
1483486068
Python
Python3
py
Runtime Error
30
7708
514
def insertion_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 = j - g cnt += 1 A[j + g] = v return cnt def shell_sort(A, n): cnt = 0 m = 5 G = [5,4,3,2,1] for i in range(m): cnt = insertion_sort(A, n, G[i], cnt)...
s099675804
p02262
u918276501
1489058846
Python
Python3
py
Runtime Error
0
0
795
def insertion_sort(a, n, g): ct = 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 ct += 1 a[j+g] = v return ct def interval_list(n): m = 0 gi= 1 g = [] while b <= n: m += 1 ...
s164504441
p02262
u918276501
1489058878
Python
Python3
py
Runtime Error
0
0
656
def insertion_sort(a, n, g): ct = 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 ct += 1 a[j+g] = v return ct def interval_list(n): m = 0 gi= 1 g = [] while b <= n: m += 1 ...
s077528309
p02262
u130834228
1490100412
Python
Python3
py
Runtime Error
0
0
1290
def InsertionSort(A, N, g): global cnt for i in range(g, N): key = A[i] j = i-g while j >= 0 and A[j] > key: A[j+g] = A[j] j = j-gdef InsertionSort(A, N, g): global cnt for i in range(g, N): key = A[i] j = i-g while j >= 0 and A[j] ...
s209064322
p02262
u796784914
1493448718
Python
Python
py
Runtime Error
0
0
699
n = input() A = [input() for i in range(n)] 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 -= g cnt += 1 A[j+g] = v return cnt def shellSort(A,n): cnt = 0 m = ...
s712969226
p02262
u091533407
1497751538
Python
Python3
py
Runtime Error
30
7868
745
# -*- coding: utf-8 -*- """ Created on Sun Jun 18 10:42:00 2017 @author: syaga """ import math def insertionSort(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 = j - g cnt += 1 A[j+g] = v ret...
s892677012
p02262
u264972437
1500305389
Python
Python3
py
Runtime Error
0
0
644
import math def insertionSort(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 = j - g cnt += 1 A[j+g] = v return A,cnt def shellSort(A,n): cnt = 0 #m = n//2 + 1 #G = [2*i + 1*(i==0) for i in range(m)[::-1]] m = int(math.log(n,2)) + 1 G = [2**i for...
s971999646
p02262
u914146430
1500789489
Python
Python3
py
Runtime Error
0
0
486
def insertionSort(a,n,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 global cnt cnt+=1 a[j+g]=v def shellsort(a,n): # global cnt cnt=0 g=[(3**i-1)//2 for i in range(n,0,-1) if (3**i-1)//2<n] ...
s139266627
p02262
u539803218
1501633736
Python
Python3
py
Runtime Error
0
0
534
import math def insertionSort(a, n, g): ct = 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 ct += 1 a[j+g] = v return ct n = int(input()) a = list(map(int, input().split())) cnt = 0 m = 0 ...
s884283877
p02262
u539803218
1501633755
Python
Python3
py
Runtime Error
0
0
534
import math def insertionSort(a, n, g): ct = 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 ct += 1 a[j+g] = v return ct n = int(input()) a = list(map(int, input().split())) cnt = 0 m = 0 ...
s602155059
p02262
u539803218
1501633766
Python
Python3
py
Runtime Error
0
0
534
import math def insertionSort(a, n, g): ct = 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 ct += 1 a[j+g] = v return ct n = int(input()) a = list(map(int, input().split())) cnt = 0 m = 0 ...
s138912733
p02262
u539803218
1501633792
Python
Python3
py
Runtime Error
0
0
548
#coding:utf-8 import math def insertionSort(a, n, g): ct = 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 ct += 1 a[j+g] = v return ct n = int(input()) a = list(map(int, input().split())) ...
s580835863
p02262
u491916705
1502095043
Python
Python
py
Runtime Error
0
0
579
n = int(raw_input()) a = [] for i in range(n): a.append(int(raw_input())) cnt = 0 num = 1 G = [1] while 1: if num*3+1 > n: break G.insert(0, num*3+1) num = num*3 + 1 m = num def insertionSort(A, n, g, cnt): for i in range(g, n): v = A[i] j = i - g while j >= 0 and A...
s002006265
p02262
u508732591
1502781361
Python
Python3
py
Runtime Error
0
0
546
import sys import math ct= 0 def insertion_sort(a, n, g): for j in range(0,n-g): v = a[j+g] while j >= 0 and a[j] > v: a[j+g] = a[j] j = j-g ct += 1 a[j+g] = v n = int(input()) a = list(map(int, sys.stdin.readlines())) b = 701 g = [x for x in [1,4,10,23,...
s775880498
p02262
u659034691
1503264572
Python
Python3
py
Runtime Error
150
8228
593
#shellSort(A, n) n=int(input()) A=[int(input()) for i in range(n)] cnt = 0 G=[1] S=str(G[0]) #if 5<n<13: t=n//2 #elif n<3000: # t=n//9 #else: # t=n//17 Gt=[4, 9, 20, 46, 103, 233, 525, 1182,2660, 5985, 13467] i=0 while Gt[i]<t: G.insert(0,Gt[i]) # print (i) S=str(G[0])+" "+S i+=1 m=len(G) print (m)...
s281115840
p02262
u024715419
1507624326
Python
Python3
py
Runtime Error
0
0
449
def insertionSort(a,n,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 cnt += 1 a[j + g] = v n = int(input()) a = [int(input()) for i in range(n)] cnt = 0 i = 0 g = [1] while 3*g[i]+1 < n: g.appen...
s980335946
p02262
u024715419
1507624579
Python
Python3
py
Runtime Error
0
0
461
def insertionSort(a,n,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 global cnt += 1 a[j + g] = v cnt = 0 n = int(input()) a = [int(input()) for i in range(n)] i = 0 g = [1] while 3*g[i]+1 < n: ...
s236149012
p02262
u928329738
1511971443
Python
Python3
py
Runtime Error
0
0
630
g_m=0 g_G=[] g_cnt=0 A=[] n = int(input()) for i in range(n): A.append(int(input())) def insertionSort(A,n,g): global 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 = j-g g_cnt += 1 A[j+g]=v ...
s346040315
p02262
u928329738
1511971681
Python
Python3
py
Runtime Error
0
0
660
g_m=0 g_G=[] g_cnt=0 A=[] n = int(input()) for i in range(n): A.append(int(input())) def insertionSort(A,n,g): global 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 = j-g g_cnt += 1 A[j+g]=v ...
s026267485
p02262
u928329738
1511973843
Python
Python3
py
Runtime Error
100
6212
661
g_m=0 g_G=[] g_cnt=0 A=[] n = int(input()) for i in range(n): A.append(int(input())) def insertionSort(A,n,g): global 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 = j-g g_cnt += 1 A[j+g]=v de...
s086091686
p02262
u928329738
1511973975
Python
Python3
py
Runtime Error
1290
10636
662
g_m=0 g_G=[] g_cnt=0 A=[] n = int(input()) for i in range(n): A.append(int(input())) def insertionSort(A,n,g): global 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 = j-g g_cnt += 1 A[j+g]=v de...
s792716712
p02262
u409571842
1514443760
Python
Python3
py
Runtime Error
350
6896
835
#coding: UTF-8 import copy class Algo: cnt = 0 @staticmethod def insertionSort(a, n, 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 -= g Algo.cnt += 1 a[j+g] = v def shellSort(a, n): if n > 40: G = [40, 13, 4...
s109786133
p02262
u409571842
1514444333
Python
Python3
py
Runtime Error
1720
11412
752
#coding: UTF-8 import copy class Algo: cnt = 0 @staticmethod def insertionSort(a, n, 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 -= g Algo.cnt += 1 a[j+g] = v def shellSort(a, n): h = 1 G = [] while h <=...
s201695706
p02262
u662418022
1516274323
Python
Python3
py
Runtime Error
1320
9852
885
# -*- coding: utf-8 -*- 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 -= g cnt += 1 A[j+g] = v def shellSort(A, n): def func(m): if m == 0: ...
s954985992
p02262
u662418022
1516275262
Python
Python3
py
Runtime Error
0
0
708
# -*- coding: utf-8 -*- 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 -= g cnt += 1 A[j+g] = v def shellSort(A, n): G = [] i = 0 g = 1 while g...
s723370130
p02262
u426534722
1516290332
Python
Python3
py
Runtime Error
0
0
583
def insertionSort(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 h = 1 G = [] while h < n: G += [h]...
s801603518
p02262
u152639966
1516303670
Python
Python3
py
Runtime Error
1900
12176
458
n=int(input()) A=[] G=[] for i in range(n): A.append(input()) cnt=0 flag=1 h=1 while flag: G.append(str(h)) h=3*h+1 if h>n: flag=0 m=len(G) G.reverse() def Insertion_Sort(A,n,g,cnt): for i in range(g,n): v=int(A[i]) j=i-g while j>=0 and int(A[j])>v: A[j+g]=A[j] j=j-g cnt+=1 A[j+g]=v return(c...
s219155712
p02262
u839008951
1516432424
Python
Python3
py
Runtime Error
4830
10620
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...