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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s892235289 | p02255 | u433154529 | 1510973533 | Python | Python3 | py | Runtime Error | 0 | 0 | 225 | n = int(input())
a = [int(i) for i in input().split()]
print(" ".join(a))
for i in range(len(a)-1):
v = a[i]
j = i
while j >= 0 and a[j]>v:
a[j+1] = a[j]
j-=1
a[j+1]=v
print(" ".join(a)) |
s108894769 | p02255 | u406002631 | 1514039032 | Python | Python3 | py | Runtime Error | 0 | 0 | 149 | z = input().split()
x = int(z[0])
y = int(z[1])
def gcd(x,y):
if y == 0:
return x
else:
return gcd(y, x % y)
print(gcd(x,y)) |
s422925466 | p02255 | u972731768 | 1514454912 | Python | Python3 | py | Runtime Error | 0 | 0 | 313 | def insertionSort(A,N):
for i in range(1,N):
v = A[i]
j=i-1
while(j>=0 and A[j] > v):
A[j+1] = A[j]
j-=1
A[j+1]=v
print(*A)
if __name__ == '__main__':
N = int(input())
A = [int(i) for i in input().split()]
print(*insertionSort(A,N)) |
s555448102 | p02255 | u972731768 | 1514455583 | Python | Python3 | py | Runtime Error | 0 | 0 | 211 | N = int(input())
A = list(map(int,input().split()))
print(*A)
for i in range(1,N):
v = A[i]
j = i - 1
while j > = 0 and A [j] > v :
A[j + 1] = A[j]
j -= 1
A[j+1] = v
print(*A) |
s546827080 | p02255 | u841567836 | 1515207633 | Python | Python3 | py | Runtime Error | 0 | 0 | 265 | if __name__ == '__main__':
N = int(input())
l = input().split()
for i in range(N):
l[i] = int(l[i])
for i in range(N - 1):
v = l[i]
j = i - 1
while j >= 0 and l[l] > v:
A[j + 1] = A[j]
j -= 1
A[j + 1] = v
print(l[0],l[1],l[2],l[3],[4],l[5])
|
s567699569 | p02255 | u841567836 | 1515207802 | Python | Python3 | py | Runtime Error | 0 | 0 | 268 | if __name__ == '__main__':
N = int(input())
l = input().split()
for i in range(N):
l[i] = int(l[i])
for i in range(1, N - 1):
v = l[i]
j = i - 1
while j >= 0 and l[l] > v:
A[j + 1] = A[j]
j -= 1
A[j + 1] = v
print(l[0],l[1],l[2],l[3],[4],l[5])
|
s628720242 | p02255 | u749243807 | 1516860105 | Python | Python3 | py | Runtime Error | 0 | 0 | 419 | count = int(input());
data = [];
for n in range(count):
data.append(int(input()));
def insert_sort(data):
show(data);
for i in range(1, len(data)):
n = data[i];
j = i - 1;
while j >= 0 and data[j] > n:
data[j + 1] = data[j];
j -= 1;
data[j + 1] = n;
show(data);
def show(data):
print(" ".join(str(n) for n in data));
insert_sort(data);
|
s773282033 | p02255 | u467422569 | 1516982553 | Python | Python3 | py | Runtime Error | 0 | 0 | 508 | def trace(A,input_num):
if i != input_num - 1:
for i in range(input_num):
print(A[i],end = " ")
else:
print(A[i])
print("\n")
def insertionSort(A,input_num):
for i in range(input_num):
v = A[i]
j = i - 1
while(j >= 0 and A[j] > v):
A[j + 1] = A[j]
j -= 1
A[j + 1] = v
trace(A,input_num)
input_num = int(input())
A = list(map(int, input().split()))
trace(A,input_num)
|
s433453949 | p02255 | u467422569 | 1516982577 | Python | Python3 | py | Runtime Error | 0 | 0 | 508 | def trace(A,input_num):
if i != input_num - 1:
for i in range(input_num):
print(A[i],end = " ")
else:
print(A[i])
print("\n")
def insertionSort(A,input_num):
for i in range(input_num):
v = A[i]
j = i - 1
while(j >= 0 and A[j] > v):
A[j + 1] = A[j]
j -= 1
A[j + 1] = v
trace(A,input_num)
input_num = int(input())
A = list(map(int, input().split()))
trace(A,input_num)
|
s706492150 | p02255 | u467422569 | 1516983262 | Python | Python | py | Runtime Error | 0 | 0 | 516 | def trace(A,input_num):
if i != input_num - 1:
for i in range(input_num):
print(A[i],end = " ")
else:
print(A[i])
print("\n")
def insertionSort(A,input_num):
for i in range(input_num):
v = A[i]
j = i - 1
while(j >= 0 and A[j] > v):
A[j + 1] = A[j]
j -= 1
A[j + 1] = v
trace(A,input_num)
input_num = int(input())
A = list(map(int, input().split()))
insertionSort(A,input_num)
|
s141613619 | p02255 | u103599511 | 1517130567 | Python | Python3 | py | Runtime Error | 0 | 0 | 246 | N = int(input())
A = [int(i) for i in input().split()]
for i in range N:
if i >= 1:
j = i - j - 1
if a[i] < a[j]:
b = a[i]
a[i] = a[i-1]
a[i-1] = b
print(a)
|
s786494647 | p02255 | u150984829 | 1518270082 | Python | Python3 | py | Runtime Error | 0 | 0 | 136 | n=int(input())
a=input().split()
for i in range(1,n):
k=int(a[i])
j=i-1
while int(a[j])>k:
a[j+1]=a[j]
j-=1
a[j+1]=k
print(*a)
|
s353057888 | p02255 | u150711673 | 1518519689 | Python | Python3 | py | Runtime Error | 0 | 0 | 258 | N = int(input())
A = map(int, input().split())
print(" ".join(map(str, A)))
for i in range(1, len(A)):
key = A[i]
j = i - 1
while j >= 0 and A[j] > key:
A[j + 1] = A[j]
j -= 1
A[j + 1] = key
print(" ".join(map(str, A)))
|
s564465555 | p02255 | u308033440 | 1520570999 | Python | Python3 | py | Runtime Error | 0 | 0 | 271 | def insertionSort(A,N):
for i in range(N):
v = A [i]
j = i-1
while j>=0 and A[j] > v:
A[j+1] = A[j]
j = j -1
A[j+1] = v
print(A)
N = input()
A = input()
A = list(map(int, A.split()))
insertionSort(A,N)
|
s406997683 | p02255 | u308033440 | 1520571094 | Python | Python3 | py | Runtime Error | 0 | 0 | 271 | def insertionSort(A,N):
for i in range(N):
v = A [i]
j = i-1
while j>=0 and A[j] > v:
A[j+1] = A[j]
j = j -1
A[j+1] = v
print(A)
N = input()
A = input()
A = list(map(int, A.split()))
insertionSort(A,N)
|
s120627497 | p02255 | u646461156 | 1520950493 | Python | Python3 | py | Runtime Error | 0 | 0 | 146 | n=int(input())
*a=map(int,input().split())
for i in range(n):
v=a[i]
j=i-1
while j>=0 and a[j]>v:
a[j+1]=a[j]
j-=1
a[j+1]=v
print(*a)
|
s042606677 | p02255 | u405478089 | 1521778896 | Python | Python | py | Runtime Error | 0 | 0 | 315 | def insertionSort(A,N):
for i in range(1,len(A)):
j = i
while (j > 0) and (A[j-1] > A[j]) :
tmp = A[j-1]
A[j-1] = A[j]
A[j] = tmp
j -= 1
print(' '.join(map(str, A)))
N = input()
N = int(N)
A = input()
A = list(map(int, A.split()))
insertionSort(A,N)
|
s988025653 | p02255 | u405478089 | 1521778937 | Python | Python | py | Runtime Error | 0 | 0 | 310 | def insertionSort(A,N):
for i in range(1,len(A)):
j = i
while (j > 0) and (A[j-1] > A[j]) :
tmp = A[j-1]
A[j-1] = A[j]
A[j] = tmp
j -= 1
print(' '.join(map(str, A)))
N = input()
N = int(N)
A = input()
A = list(map(int, A.split()))
insertionSort(A,N)
|
s287915340 | p02255 | u464859367 | 1521818234 | Python | Python3 | py | Runtime Error | 0 | 0 | 286 | N = input()
array = list(map(int, input().split()))
for i in range(1, N):
v = array[i]
j = i - 1
while j >= 0 and array[j] > v:
array[j + 1] = array[j]
j -= 1
array[j + 1] = v
array = list(map(str, array))
x = " ".join(array)
print(x)
|
s156423944 | p02255 | u017435045 | 1523932556 | Python | Python3 | py | Runtime Error | 0 | 0 | 171 | n = int(input())
a = [i in int(input())]
for i in range(n):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>0:
a[j+1] = a[j]
a[j] = v
j -=1
|
s902961823 | p02255 | u017435045 | 1523932573 | Python | Python3 | py | Runtime Error | 0 | 0 | 171 | n = int(input())
a = [i in int(input())]
for i in range(n):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>0:
a[j+1] = a[j]
a[j] = v
j -=1
|
s398243161 | p02255 | u017435045 | 1523936803 | Python | Python3 | py | Runtime Error | 0 | 0 | 171 | n = int(input())
a = [i in int(input())]
for i in range(n):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>0:
a[j+1] = a[j]
a[j] = v
j -=1
|
s508628298 | p02255 | u017435045 | 1523936954 | Python | Python3 | py | Runtime Error | 0 | 0 | 176 | n = int(input())
a = [i in int(input())]
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>=0:
a[j+1] = a[j]
a[j] = v
j -=1
|
s689103179 | p02255 | u017435045 | 1523936983 | Python | Python3 | py | Runtime Error | 0 | 0 | 187 | n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>=0:
a[j+1] = a[j]
a[j] = v
j -=1
|
s261706969 | p02255 | u017435045 | 1523937446 | Python | Python3 | py | Runtime Error | 0 | 0 | 185 | n = int(input())
a = [i in int(input())]
for i in range(n):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>0:
a[j+1] = a[j]
a[j] = v
j -=1
print(*a)
|
s773467338 | p02255 | u017435045 | 1523937467 | Python | Python3 | py | Runtime Error | 0 | 0 | 194 | n = int(input())
a = [i in int(input().split()))]
for i in range(n):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>0:
a[j+1] = a[j]
a[j] = v
j -=1
print(*a)
|
s925141281 | p02255 | u017435045 | 1523937505 | Python | Python3 | py | Runtime Error | 0 | 0 | 198 | n = int(input())
a = [i in int(input().split()))]
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>0:
a[j+1] = a[j]
a[j] = v
j -=1
print(*a)
|
s268838532 | p02255 | u017435045 | 1523937677 | Python | Python3 | py | Runtime Error | 0 | 0 | 190 | n = int(input())
a = [i in int(input().split()))]
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>a[j+1] and j>0:
a[j] = v
j -=1
a[j+1] =
print(*a)
|
s779172151 | p02255 | u017435045 | 1523937930 | Python | Python3 | py | Runtime Error | 0 | 0 | 195 | n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>0:
a[j+1] = a[j]
a[j] = v
j -=1
print(*a)
|
s367588225 | p02255 | u017435045 | 1523938015 | Python | Python3 | py | Runtime Error | 0 | 0 | 175 | n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j] = v
j -=1
print(*a)
|
s804038533 | p02255 | u017435045 | 1523938230 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s908678734 | p02255 | u017435045 | 1523938265 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s914227412 | p02255 | u017435045 | 1523938290 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s913592191 | p02255 | u017435045 | 1523938291 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s222089128 | p02255 | u017435045 | 1523938376 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s528429144 | p02255 | u017435045 | 1523938624 | Python | Python3 | py | Runtime Error | 0 | 0 | 189 | n = int(input())
a = [i in int(input().split())]
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s975698113 | p02255 | u017435045 | 1523938649 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s306006779 | p02255 | u017435045 | 1523938742 | Python | Python3 | py | Runtime Error | 0 | 0 | 195 | n = int(input())
a = [i for i in int(input().split())]
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s476318387 | p02255 | u017435045 | 1523938820 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s375700176 | p02255 | u017435045 | 1523939047 | Python | Python3 | py | Runtime Error | 0 | 0 | 191 | n = int(input())
a = [i for i in int(input().split())]
for i in range(n):
v = a[i]
j = i-1
while a[j]>v and j>=0:
a[j+1] = a[j]
j -=1
a[j] = v
print(*a)
|
s653956895 | p02255 | u848218390 | 1524037803 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n = int(input())
A = map(int, input().split())
for i in range(1, n):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(A)
|
s003410161 | p02255 | u609614788 | 1524038800 | Python | Python3 | py | Runtime Error | 0 | 0 | 469 | #include<iostream>
#include<cstdlib>
void insertionSort(int A[],int N){
int v,j;
for(int i=1;i<=N-1;i++){
v=A[i];
j=i-1;
while(j>=0 and A[j]>v){
A[j+1]=A[j];
j--;
A[j+1]=v;
}
}
}
int main(){
int N;
std::cin>>N;
int a[N]={0};
for(int i=0;i<N;i++){
std::cin>>a[i];
}
for(int j=1;j<=N;j++){
insertionSort(a,j);
for(int k=0;k<N;k++){
std::cout<<a[k]<<" ";
}
std::cout<<'\n';
}
return 0;
}
|
s233790538 | p02255 | u909075105 | 1524038908 | Python | Python3 | py | Runtime Error | 0 | 0 | 244 | # 1_A 16D8101023J 久保田凌弥 2018/4/18
import numpy as np
a=int(input())
*A, = map(int, input().split())
for i in range(a):
j=0
while 1:
if j==i:
print(np.round(A))
break
if A[i]<A[j]:
x=A[i]
A[i]=A[j]
A[j]=x
j+=1
|
s415783789 | p02255 | u909075105 | 1524038923 | Python | Python3 | py | Runtime Error | 0 | 0 | 244 | # 1_A 16D8101023J 久保田凌弥 2018/4/18
import numpy as np
a=int(input())
*A, = map(int, input().split())
for i in range(a):
j=0
while 1:
if j==i:
print(np.round(A))
break
if A[i]<A[j]:
x=A[i]
A[i]=A[j]
A[j]=x
j+=1
|
s556060580 | p02255 | u909075105 | 1524038938 | Python | Python3 | py | Runtime Error | 0 | 0 | 244 | # 1_A 16D8101023J 久保田凌弥 2018/4/18
import numpy as np
a=int(input())
*A, = map(int, input().split())
for i in range(a):
j=0
while 1:
if j==i:
print(np.round(A))
break
if A[i]<A[j]:
x=A[i]
A[i]=A[j]
A[j]=x
j+=1
|
s779460367 | p02255 | u909075105 | 1524039053 | Python | Python3 | py | Runtime Error | 0 | 0 | 244 | # 1_A 16D8101023J 久保田凌弥 2018/4/18
import numpy as np
a=int(input())
*A, = map(int, input().split())
for i in range(a):
j=0
while 1:
if j==i:
print(np.round(A))
break
if A[i]<A[j]:
x=A[i]
A[i]=A[j]
A[j]=x
j+=1
|
s719787163 | p02255 | u032728894 | 1524039551 | Python | Python3 | py | Runtime Error | 0 | 0 | 276 | #16D8102008K 1-A:Insertion Sort 柳生 葉月 Yagyu Hauzki
import numpy as np
N=int(input(""))
A=np.zeros(N)
A=[int(i)for i in input().split()]
for i in range(N):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j=j-1
A[j+1]=v
print(A)
|
s842291443 | p02255 | u848218390 | 1524039861 | Python | Python3 | py | Runtime Error | 0 | 0 | 387 | def insertionsort(A, n):
for i in range(1, n):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
prt(A)
def prt(A):
for i in A:
if i != A[len(A)-1]: print(i, end=" ")
else print(i)
n = int(input())
A = input().split()
A = [int(i) for i in A]
prt(A)
insertionsort(A, n)
|
s653586111 | p02255 | u477717106 | 1524040659 | Python | Python3 | py | Runtime Error | 0 | 0 | 186 | def insertionSort(A,N):
for i in range(1,N-1):
v=A[i]
j=i-1
while(j>=0 && A[j]>v):
A[j+1]=A[j]
j--
A[j+1]=v
return A
|
s171852095 | p02255 | u461923444 | 1524040875 | Python | Python3 | py | Runtime Error | 0 | 0 | 127 | file:///jugyou/ise/16D8104004E/%E5%AE%9F%E8%B7%B5%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0/Insertion.py
|
s243608813 | p02255 | u810098703 | 1524041026 | Python | Python | py | Runtime Error | 0 | 0 | 209 | N = int(input(""))
A = [int(i) for i in input().split()]
for i in range(1,N):
v = A[i]
j = i-1
while j >= 0 and A[j]>v:
A[j+1] = A[j]
j = j -1
A[j+1] = v
print(A)
|
s524174637 | p02255 | u810098703 | 1524041096 | Python | Python | py | Runtime Error | 0 | 0 | 207 | N = int(input(""))
A = [int(i) for i in input().split()]
for i in range(1,N):
v = A[i]
j = i-1
while j >= 0 and A[j]>v:
A[j+1] = A[j]
j = j -1
A[j+1] = v
print(A)
|
s991175946 | p02255 | u032728894 | 1524041372 | Python | Python3 | py | Runtime Error | 0 | 0 | 294 | #16D8102008K 1-A:Insertion Sort 柳生 葉月 Yagyu Hauzki
import numpy as np
N=int(input(""))
A=np.zeros(N)
A=[int(i)for i in input().split()]
for i in range(N):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j=j-1
A[j+1]=v
print(''.join(map(str,A)))
|
s119702218 | p02255 | u032728894 | 1524041392 | Python | Python3 | py | Runtime Error | 0 | 0 | 231 | import numpy as np
N=int(input(""))
A=np.zeros(N)
A=[int(i)for i in input().split()]
for i in range(N):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j=j-1
A[j+1]=v
print(''.join(map(str,A)))
|
s714999162 | p02255 | u032728894 | 1524041411 | Python | Python3 | py | Runtime Error | 0 | 0 | 231 | import numpy as np
N=int(input(""))
A=np.zeros(N)
A=[int(i)for i in input().split()]
for i in range(N):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j=j-1
A[j+1]=v
print(''.join(map(str,A)))
|
s658805920 | p02255 | u810098703 | 1524041441 | Python | Python | py | Runtime Error | 0 | 0 | 210 | N = int(input(""))
A = [int(i) for i in input().split()]
j = 0
for i in range(1,N):
v = A[i]
j = i-1
while j >= 0 and A[j]>v:
A[j+1] = A[j]
j = j -1
A[j+1] = v
print(A)
|
s378337557 | p02255 | u032728894 | 1524041493 | Python | Python3 | py | Runtime Error | 0 | 0 | 232 |
import numpy as np
N=int(input(""))
A=np.zeros(N)
A=[int(i)for i in input().split()]
for i in range(N):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j=j-1
A[j+1]=v
print(''.join(map(str,A)))
|
s939008853 | p02255 | u826549974 | 1524041904 | Python | Python3 | py | Runtime Error | 0 | 0 | 370 | # 16D8101022L 小林勇希 ID:k_mb python3
import math
cou = 0
n = int(input())
A = [int(input()) for i in range(n)]
for i in range(n):
a_sq = int(math.sqrt(A[i]))
for j in range(2,a_sq+2):
if(A[i]%j==0 and not(A[i]==j)):
break
if(j==a_sq+1):
cou += 1
print(cou)
"""実行結果
5
2
3
4
5
6
3
5
2
2
2
2
2
5
"""
|
s491563693 | p02255 | u405027099 | 1524041968 | Python | Python3 | py | Runtime Error | 0 | 0 | 253 | import numpy as np
N=int(input())
A=np.empty((N))
A=input().split()
for i in range(N):
A[i]=(int)(A[i])
for i in range(N):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j=j-1
A[j+1] = v
print(A)
|
s248587680 | p02255 | u405027099 | 1524042548 | Python | Python3 | py | Runtime Error | 0 | 0 | 356 | import numpy as np
N=int(input())
A=np.empty((N))
A=input().split()
for i in range(N):
A[i]=(int)(A[i])
for i in range(N):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j=j-1
A[j+1] = v
for k in range(N):
if k<N-1:
print(A[k],end=" ")
else:
print(A[k])
|
s743915272 | p02255 | u405027099 | 1524042633 | Python | Python3 | py | Runtime Error | 0 | 0 | 356 | import numpy as np
N=int(input())
A=np.empty((N))
A=input().split()
for i in range(N):
A[i]=(int)(A[i])
for i in range(N):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j=j-1
A[j+1] = v
for k in range(N):
if k<N-1:
print(A[k],end=" ")
else:
print(A[k])
|
s584632457 | p02255 | u405027099 | 1524042871 | Python | Python3 | py | Runtime Error | 0 | 0 | 361 | import numpy as np
N=int(input())
A=np.empty((N))
A=input().split()
for i in range(N):
A[i]=(int)(A[i])
for i in range(N):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j=j-1
A[j+1] = v
for k in range(N):
if k<N-1:
print(A[k],end=" ")
if k==N-1:
print(A[k])
|
s445865181 | p02255 | u217703215 | 1524133789 | Python | Python3 | py | Runtime Error | 0 | 0 | 338 | N=int(input())
A=[0 for i in range(N)]
A=input().split()
for i in range(N):
A[i]=(int)(A[i])
for i in range(1,N):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j-=1
A[j+1]=v
for i in range(N):
if i!=N-1:
print(A[i],end=" ")
if i==N-1:
print(A[i])
"""
|
s631972913 | p02255 | u865220118 | 1524197407 | Python | Python3 | py | Runtime Error | 0 | 0 | 417 | # リストの宣言
A = []
# 入力の最初の行に、数列の長さを表す整数 N が与えられます。
# 2 行目に、N 個の整数が空白区切りで与えられます。
NUM =int(input())
A = input().split()
NUMLIST = range (1, NUM + 1)
# for i = 1 to A.length-1
for i in NUMLIST:
# key = A[i]
key = A[i]
j = i - 1
while j >= 0 and A[j] > key:
A[j+1] = A[j]
j-=1
A[j+1] = key
|
s602296904 | p02255 | u861315468 | 1524238972 | Python | Python | py | Runtime Error | 0 | 0 | 181 | n=int(input())
a=input().split()
b=[int(i) for i in a]
print(b)
i=0
for i in range(1,n):
v=b[i]
j=i-1
while j>=0 and b[j]>v:
b[j+1]=b[j]
j-=1
b[j+1]=v
print(b)
|
s425537845 | p02255 | u810922275 | 1524444589 | Python | Python | py | Runtime Error | 0 | 0 | 230 | import numpy as np
n=int(input())
A=np.empty(n)
for i in range(n):
A[i]=int(input())
print(A)
for i in range(1,n):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j=j-1
A[j+1]=v
print(A)
|
s520954871 | p02255 | u810922275 | 1524445601 | Python | Python | py | Runtime Error | 0 | 0 | 210 | import numpy as np
n=int(input())
A=list(map(int,input().split(' ')))
print(A)
for i in range(1,n):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j=j-1
A[j+1]=v
print(A)
|
s828228716 | p02255 | u477717106 | 1524470772 | Python | Python3 | py | Runtime Error | 0 | 0 | 331 | def trace(s):
print " ".join(map(str,s))
n = input()
A = map(int, raw_input().split())
if len(A) != n: exit()
trace(A)
for i in xrange(1, n):
key = A[i]
j = i - 1
while j >= 0 and A[j] > key:
A[j+1] = A[j]
j -= 1
A[j+1] = key
trace(A)
|
s647361920 | p02255 | u481571686 | 1524492285 | Python | Python3 | py | Runtime Error | 0 | 0 | 169 | n=int(input())
a=list(map(int,input(),split()))
for i in range(n):
v=a[i]
j=i-1
while j>=0 and a[j]>v:
a[j+1]=a[j]
j=j-1
a[j+1]=v
print(' '.join(map(str,a)))
|
s605698277 | p02255 | u481571686 | 1524492342 | Python | Python3 | py | Runtime Error | 0 | 0 | 199 | n=int(input())
a=list(map(int,input(),split()))
print(' '.join(map(str,a)))
for i in range(1,n):
v=a[i]
j=i-1
while j>=0 and a[j]>v:
a[j+1]=a[j]
j=j-1
a[j+1]=v
print(' '.join(map(str,a)))
|
s894710914 | p02255 | u909075105 | 1524560146 | Python | Python3 | py | Runtime Error | 0 | 0 | 261 | #16D8101023J 久保田凌弥 kubotarouxxx python3
import numpy as np
a=int(input())
A=map(int, raw_input().split())
for i in range(a):
for j in range(a):
if i==j:
print(np.round(A)
continue
if A[j]>=A[i]:
x=A[j]
A[j]=A[i]
A[i]=x
|
s499943589 | p02255 | u909075105 | 1524560158 | Python | Python | py | Runtime Error | 0 | 0 | 261 | #16D8101023J 久保田凌弥 kubotarouxxx python3
import numpy as np
a=int(input())
A=map(int, raw_input().split())
for i in range(a):
for j in range(a):
if i==j:
print(np.round(A)
continue
if A[j]>=A[i]:
x=A[j]
A[j]=A[i]
A[i]=x
|
s960365163 | p02255 | u909075105 | 1524560243 | Python | Python3 | py | Runtime Error | 0 | 0 | 252 | #16D8101023J 久保田凌弥 kubotarouxxx python3
import numpy as np
a=int(input())
A=map(int, raw_input().split())
for i in range(a):
for j in range(a):
if i==j:
print(np.round(A))
continue
if A[j]>=A[i]:
x=A[j]
A[j]=A[i]
A[i]=x
|
s285478925 | p02255 | u909075105 | 1524561139 | Python | Python3 | py | Runtime Error | 0 | 0 | 269 | #16D8101023J 久保田凌弥 kubotarouxxx python3
import numpy as np
a=int(input())
A=map(int, raw_input().split())
for i in range(a):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(np.round(A)
|
s373739537 | p02255 | u909075105 | 1524561258 | Python | Python3 | py | Runtime Error | 0 | 0 | 270 | #16D8101023J 久保田凌弥 kubotarouxxx python3
import numpy as np
a=int(input())
A=map(int, raw_input().split())
for i in range(a):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(np.round(A))
|
s962448024 | p02255 | u909075105 | 1524561268 | Python | Python | py | Runtime Error | 0 | 0 | 270 | #16D8101023J 久保田凌弥 kubotarouxxx python3
import numpy as np
a=int(input())
A=map(int, raw_input().split())
for i in range(a):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(np.round(A))
|
s211177995 | p02255 | u909075105 | 1524564463 | Python | Python3 | py | Runtime Error | 0 | 0 | 270 | #16D8101023J 久保田凌弥 kubotarouxxx python3
import numpy as np
a=int(input())
A=map(int, raw_input().split())
for i in range(a):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(np.round(A))
|
s095896578 | p02255 | u909075105 | 1524564566 | Python | Python3 | py | Runtime Error | 0 | 0 | 220 | import numpy as np
a=int(input())
A=map(int, raw_input().split())
for i in range(a):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(np.round(A))
|
s380693303 | p02255 | u909075105 | 1524570681 | Python | Python3 | py | Runtime Error | 0 | 0 | 265 | #16D8101023J 久保田凌弥 kubotarouxxx python3
import numpy as np
a=int(input())
A=map(int, input().split())
for i in range(a):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(np.round(A))
|
s406729251 | p02255 | u663087805 | 1524579518 | Python | Python3 | py | Runtime Error | 0 | 0 | 337 | import numpy as np
def trace(A,N):
for i in range(N):
print(A[i]," ",end="")
print("")
def insertion_Sort(A,N):
for i in range(1,N):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j = j -1
A[j+1]=v
trace(A,N)
N = int(input())
A = list(map(int, input().split()))
trace(A,N)
insertion_Sort(A, N)
|
s328444099 | p02255 | u728137020 | 1524611423 | Python | Python3 | py | Runtime Error | 0 | 0 | 298 | n=int(input())
list=list(map(int,input().split()))
for i in range(1,N):
v=A[i]
j=i-1
while j>=0 and A[j]>v:
A[j+1]=A[j]
j=j-1
A[j+1]=v
for i in range(len(A)):
if i!=len(A)-1:
print(A[i],end=' ')
else :
print(A[i])
|
s001259221 | p02255 | u252641015 | 1524635830 | Python | Python3 | py | Runtime Error | 0 | 0 | 415 | #include<stdio.h>
int main(void){
int n;
int v,j=0,i=0,k=0;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
for(i=0;i<n;i++){
v=A[i];
j=i-1;
if(i>=1){
for(k=0;k<n;k++){
printf("%d ",A[k]);
}
}
printf("\n");
while(j>=0 && A[j]>v){
A[j+1]=A[j];
j=j-1;
A[j+1]=v;
}
}
for(k=0;k<n;k++){
printf("%d ",A[k]);
}
return 0;
}
|
s652913153 | p02255 | u407235534 | 1524719279 | Python | Python3 | py | Runtime Error | 0 | 0 | 300 | def print_tmp(a_li):
t = ' '.join(a_li)
print(t)
n = int(input())
a = input()
A = [int(i) for i in a.split(' ')]
print_tmp(A)
for i in range(1, n-1):
v = A[i]
j = i -1
while j >= 0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print_tmp(A)
print_tmp(A)
|
s350243864 | p02255 | u682153677 | 1525503760 | Python | Python3 | py | Runtime Error | 0 | 0 | 294 | # -*- coding: utf-8 -*-
N = int(input())
A = list(map(int, input().split()))
for i in range(0, N):
v = A[i]
j = i
while (j >= 0) and (A[j] > j):
A[j + 1] = A[j]
j -= 1
A[j + 1] = v
for k in range(N):
print('{0} '.format(A[k]), end='')
print()
|
s968023232 | p02255 | u405478089 | 1527214214 | Python | Python | py | Runtime Error | 0 | 0 | 306 | def insertionSort(A,N):
for i in range(N):
j = i
while (j > 0) and (A[j-1] > A[j]) :
tmp = A[j-1]
A[j-1] = A[j]
A[j] = tmp
j -= 1
print(' '.join(map(str, A)))
N = input()
N = int(N)
A = input()
A = list(map(int, A.split()))
insertionSort(A,N)
|
s994778003 | p02255 | u303842929 | 1527500923 | Python | Python3 | py | Runtime Error | 0 | 0 | 729 | #include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <numeric>
#include <ctype.h>
using namespace std;
void print(vector<int> v);
int main(void){
int N, num;
vector<int> v;
cin >> N;
for(int i = 0; i < N; i++){
cin >> num;
v.push_back(num);
}
for(int i = 1; i < N; i++){
int x = v[i];
int j = i - 1;
while(j >= 0 && v[j] > x){
v[j + 1] = v[j];
j--;
v[j + 1] = x;
}
print(v);
}
}
void print(vector<int> v){
for(int i = 0; i < v.size(); i++){
cout << v[i];
if(i != v.size() - 1) cout << ' ';
}
cout << endl;
}
|
s245499518 | p02255 | u303842929 | 1527501311 | Python | Python3 | py | Runtime Error | 0 | 0 | 605 | #include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <numeric>
#include <ctype.h>
using namespace std;
void print(vector<int> v);
int main(void){
int N, num;
vector<int> v;
cin >> N;
for(int i = 0; i < N; i++){
cin >> num;
v.push_back(num);
}
for(int i = 1; i < N; i++){
print(v);
int x = v[i];
int j = i - 1;
while(j >= 0 && v[j] > x){
v[j + 1] = v[j];
j--;
v[j + 1] = x;
}
}
print(v);
}
void print(vector<int> v){
for(int i = 0; i < v.size(); i++){
cout << v[i];
if(i != v.size() - 1) cout << ' ';
}
cout << endl;
}
|
s602876789 | p02255 | u559653147 | 1527866812 | Python | Python3 | py | Runtime Error | 0 | 0 | 330 | #!usr/env/python3
#-*- encode: utf-8 -*-
n = input()
data = map(int, input().split())
i = 1
print(" ".join(map(str, data)))
while (i < len(data)):
key = data[i]
j = i - 1
while (j >= 0 and data[j] > key):
data[j+1] = data[j]
j -= 1
data[j+1] = key
print(" ".join(map(str, data)))
i += 1
|
s371165281 | p02255 | u559653147 | 1527867065 | Python | Python3 | py | Runtime Error | 0 | 0 | 293 | n = int(input())
data = map(int, input().split())
i = 1
print(" ".join(map(str, data)))
while (i < len(data)):
key = data[i]
j = i - 1
while (j >= 0 and data[j] > key):
data[j+1] = data[j]
j -= 1
data[j+1] = key
print(" ".join(map(str, data)))
i += 1
|
s023948815 | p02255 | u242415969 | 1528539787 | Python | Python3 | py | Runtime Error | 0 | 0 | 207 | for i in range(N):
v = A[i]
j = i -1
while j >=0 and A[j] > v :
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(" ".join(map(str, A)))
|
s679971032 | p02255 | u242415969 | 1528539909 | Python | Python3 | py | Runtime Error | 0 | 0 | 207 | for i in range(N):
v = A[i]
j = i -1
while j >=0 and A[j] > v :
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(" ".join(map(str, A)))
|
s197097960 | p02255 | u242415969 | 1528540164 | Python | Python3 | py | Runtime Error | 0 | 0 | 208 | for i in range(N):
v = A[i]
j = i -1
while j >=0 and A[j] > v :
A[j+1] = A[j]
j -= 1
A[j+1] = v
print(" ".join(map(str, A)))
|
s820727932 | p02255 | u457728280 | 1529247800 | Python | Python3 | py | Runtime Error | 0 | 0 | 418 | intMax = -100000000
inputData = int(input())
inputList = list()
count = 0
while count < inputData:
inputList.append(int(input()))
count = count + 1
inputDataMax = intMax
inputDataMin = inputList[0]
count2 = 1
while count2 < inputData:
inputDataMax = max(inputDataMax, inputList[count2] - inputDataMin)
inputDataMin = min(inputDataMin, inputList[count2])
count2 = count2 + 1
print(inputDataMax)
|
s091648188 | p02255 | u457728280 | 1529247847 | Python | Python3 | py | Runtime Error | 0 | 0 | 418 | intMax = -100000000
inputData = int(input())
inputList = list()
count = 0
while count < inputData:
inputList.append(int(input()))
count = count + 1
inputDataMax = intMax
inputDataMin = inputList[0]
count2 = 1
while count2 < inputData:
inputDataMax = max(inputDataMax, inputList[count2] - inputDataMin)
inputDataMin = min(inputDataMin, inputList[count2])
count2 = count2 + 1
print(inputDataMax)
|
s944211980 | p02255 | u457728280 | 1529248245 | Python | Python3 | py | Runtime Error | 0 | 0 | 218 | intMax = -100000000
inputData = int(input())
inputList = list()
count = 0
while count < inputData:
inputList.append(int(input()))
count = count + 1
inputDataMax = intMax
inputDataMin = inputList[0]
count2 = 1
|
s003102824 | p02255 | u457728280 | 1529248341 | Python | Python3 | py | Runtime Error | 0 | 0 | 157 | intMax = -100000000
inputData = int(input())
inputList = list()
count = 0
while count < inputData:
inputList.append(int(input()))
count = count + 1
|
s178509585 | p02255 | u457728280 | 1529248404 | Python | Python3 | py | Runtime Error | 0 | 0 | 159 | intMax = -100000000
inputData = int(input())
inputList = list()
count = 0
while count < inputData:
inputList.append(int(input()))
count = count + 1
|
s465703488 | p02255 | u457728280 | 1529248692 | Python | Python3 | py | Runtime Error | 0 | 0 | 87 | intMax = -100000000
inputData = int(input())
inputList = list(int(input()))
count = 1
|
s922197073 | p02255 | u457728280 | 1529248830 | Python | Python3 | py | Runtime Error | 0 | 0 | 178 | intMax = -100000000
inputData = int(input())
inputList = list()
count = 0
while count < inputData:
tmpData = int(input())
inputList.append(tmpData)
count = count + 1
|
s890955986 | p02255 | u457728280 | 1529248858 | Python | Python3 | py | Runtime Error | 0 | 0 | 126 | intMax = -100000000
inputData = int(input())
inputList = list()
count = 0
while count < inputData:
tmpData = int(input())
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.