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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s210061729 | p02255 | u457728280 | 1529249116 | Python | Python3 | py | Runtime Error | 0 | 0 | 180 | intMax = -100000000
inputData = int(input())
inputList = list()
count = 0
while count < inputData:
tmpData = int(input())
inputList.append(tmpData)
count = count + 1
|
s875662074 | p02255 | u153665391 | 1529512215 | Python | Python3 | py | Runtime Error | 0 | 0 | 442 | N = int(input())
A = list(map(int, input().split()))
if __name__ == '__main__':
print(" ".join(A))
for i in range(1, N):
target_num = A[i]
for j in range(i):
if A[j] > target_num:
tmp_idx = i
while j < tmp_idx:
A[tmp_idx] = A[tmp_idx-1]
tmp_idx -= 1
A[j] = target_num
break
print(" ".join(A))
|
s569092516 | p02255 | u646764397 | 1530325438 | Python | Python3 | py | Runtime Error | 0 | 0 | 247 | N = map(int, raw_input().split())
a = []
for i in range(N):
a.append(map(int, raw_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)
|
s479157267 | p02255 | u646764397 | 1530325579 | Python | Python3 | py | Runtime Error | 0 | 0 | 247 | N = map(int, raw_input().split())
a = []
for i in range(N):
a.append(map(int, raw_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)
|
s758442682 | p02255 | u646764397 | 1530325877 | Python | Python3 | py | Runtime Error | 0 | 0 | 239 | N = map(int, raw_input())
a = []
for i in range(N):
a.append(map(int, raw_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)
|
s073196223 | p02255 | u646764397 | 1530326048 | Python | Python3 | py | Runtime Error | 0 | 0 | 209 | N = input()
a = []
for i in range(N):
a.append(input())
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)
|
s734953563 | p02255 | u646764397 | 1530326181 | Python | Python3 | py | Runtime Error | 0 | 0 | 219 | N = int(input())
a = []
for i in range(N):
a.append(input())
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)
|
s852841523 | p02255 | u646764397 | 1530326507 | Python | Python3 | py | Runtime Error | 0 | 0 | 221 | N = int(input(0))
a = []
for i in range(N):
a.append(input(1))
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)
|
s232685542 | p02255 | u646764397 | 1530327160 | Python | Python3 | py | Runtime Error | 0 | 0 | 219 | N = int(input())
a = []
for i in range(N):
a.append(input())
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)
|
s678503373 | p02255 | u646764397 | 1530327296 | Python | Python3 | py | Runtime Error | 0 | 0 | 207 | N = input()
a = []
for i in range(N):
a.append(input())
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)
|
s269561637 | p02255 | u646764397 | 1530327375 | Python | Python3 | py | Runtime Error | 0 | 0 | 217 | N = int(input())
a = []
for i in range(N):
a.append(int(input()))
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)
|
s762559608 | p02255 | u646764397 | 1530327573 | Python | Python3 | py | Runtime Error | 0 | 0 | 212 | N = int(input())
a = []
for i in range(N):
a.append(input())
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)
|
s287885871 | p02255 | u646764397 | 1530327760 | Python | Python3 | py | Runtime Error | 0 | 0 | 216 | N = int(input())
a = []
for i in range(N):
a.append(map(int, input())
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)
|
s228968099 | p02255 | u646764397 | 1530327811 | Python | Python3 | py | Runtime Error | 0 | 0 | 217 | N = int(input())
a = []
for i in range(N):
a.append(map(int, input())
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)
|
s208856922 | p02255 | u646764397 | 1530327976 | Python | Python3 | py | Runtime Error | 0 | 0 | 224 | N = int(input())
a = []
for i in range(N):
a.append(map(int, input())
N = N+1
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)
|
s384442178 | p02255 | u646764397 | 1530328142 | Python | Python3 | py | Runtime Error | 0 | 0 | 216 | N = int(input())
a = []
for i in range(N):
a.append(map(int, input())
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)
|
s581634435 | p02255 | u646764397 | 1530328199 | Python | Python3 | py | Runtime Error | 0 | 0 | 229 | N = int(input())
a = []
for i in range(N):
a.append(map(int, input())
int(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)
|
s578587128 | p02255 | u646764397 | 1530328242 | Python | Python3 | py | Runtime Error | 0 | 0 | 224 | N = map(int,input())
a = []
for i in range(N):
a.append(map(int, input())
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)
|
s694089374 | p02255 | u646764397 | 1530328274 | Python | Python3 | py | Runtime Error | 0 | 0 | 240 | N = map(int,input().split())
a = []
for i in range(N):
a.append(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(a)
|
s893566254 | p02255 | u646764397 | 1530328423 | Python | Python3 | py | Runtime Error | 0 | 0 | 248 | N = map(int,input().split())
a = []
for i in range(N):
a.append(map(int, input().split())
v = a[0]
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)
|
s150610481 | p02255 | u646764397 | 1530328440 | Python | Python3 | py | Runtime Error | 0 | 0 | 248 | N = map(int,input().split())
N = N+1
a = []
for i in range(N):
a.append(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(a)
|
s588067564 | p02255 | u646764397 | 1530328468 | Python | Python3 | py | Runtime Error | 0 | 0 | 248 | N = map(int,input().split())
a = []
for i in range(N):
a.append(map(int, input().split())
N = N+1
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)
|
s822003532 | p02255 | u646764397 | 1530328707 | Python | Python3 | py | Runtime Error | 0 | 0 | 242 | N = map(int,input().split())
a = []
for i in range(N):
a.append(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(a)
|
s692037297 | p02255 | u646764397 | 1530328747 | Python | Python3 | py | Runtime Error | 0 | 0 | 223 | N = input()
a = []
for i in range(N):
a.append(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(a)
|
s854267471 | p02255 | u646764397 | 1530328762 | Python | Python3 | py | Runtime Error | 0 | 0 | 228 | N = int(input())
a = []
for i in range(N):
a.append(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(a)
|
s276991381 | p02255 | u646764397 | 1530333186 | Python | Python3 | py | Runtime Error | 0 | 0 | 205 | N = int(input())
a = []
a.append(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(a)
|
s601444578 | p02255 | u646764397 | 1530333804 | Python | Python3 | py | Runtime Error | 0 | 0 | 205 | N = int(input())
a = []
a.append(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(a)
|
s355264865 | p02255 | u511257811 | 1381754931 | Python | Python | py | Runtime Error | 20 | 4228 | 369 | import sys
for lineCnt, line in enumerate(sys.stdin):
if lineCnt == 0:
N = int(line.rstrip('\n'))
else:
A = map(int, line.rstrip('\n').split(' '))
for j in range(1, N):
print ' '.join(map(str, A))
key = A[j]
i = j - 1
while i >= 0 and A[i] > key:
A[i+1] = A[i]
i -= 1
A[i+1] = key
print ' '.join(map(str, A)) |
s740310978 | p02255 | u904989881 | 1391583268 | Python | Python | py | Runtime Error | 0 | 0 | 256 | n = input()
A = map(int,raw_input().split())
print A
for j in range(1,n):
key = A[j]
# insert A[j] into the sorted sequence A[1,...,j-1]
i = j - 1
while i >= 0 and A[i] > key:
A[i+1] = A[i]
i -= 1
A[i+1] = key
print A |
s183211974 | p02255 | u633068244 | 1393695986 | Python | Python | py | Runtime Error | 0 | 0 | 317 | def: isort(n,a):
print " ".join(map(str, a))
for j in range(1,n):
key = a[j]
i = j-1
while i >= 0 and a[i] > key:
a[i+1] = a[i]
i = i - 1
a[i+1] = key
print " ".join(map(str, a))
n = int(raw_input())
a = map(int, raw_input().split())
isort(n,a) |
s476255150 | p02256 | u302561071 | 1532007522 | Python | Python | py | Runtime Error | 0 | 0 | 411 | x = input()
y = input()
if x < y:
tmp = x
x = y
y = tmp
x_y_divisor = list()
y_divisor = list()
x_mod_y = x % y
for i in range(1,(x_mod_y)+1):
if x_mod_y % i == 0:
x_y_divisor.append(i)
for i in range(1,y+1):
if y % i == 0:
y_divisor.append(i)
x_y_divisor_set = set(x_y_divisor)
y_divisor_set = set(y_divisor)
ans_divisor = y_divisor_set.intersection(x_y_divisor_set)
print(max(ans_divisor))
|
s920311529 | p02256 | u302561071 | 1532007655 | Python | Python | py | Runtime Error | 10 | 4664 | 467 | input_list = map(int, raw_input().split())
x = input_list[0]
y = input_list[1]
if x < y:
tmp = x
x = y
y = tmp
x_y_divisor = list()
y_divisor = list()
x_mod_y = x % y
for i in range(1,(x_mod_y)+1):
if x_mod_y % i == 0:
x_y_divisor.append(i)
for i in range(1,y+1):
if y % i == 0:
y_divisor.append(i)
x_y_divisor_set = set(x_y_divisor)
y_divisor_set = set(y_divisor)
ans_divisor = y_divisor_set.intersection(x_y_divisor_set)
print(max(ans_divisor))
|
s454314894 | p02256 | u260169299 | 1534868285 | Python | Python3 | py | Runtime Error | 0 | 0 | 181 | import java.util.scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int a = scan.nextInt(scan);
System.out.println(a);
}
}
|
s856967544 | p02256 | u260169299 | 1534868310 | Python | Python3 | py | Runtime Error | 0 | 0 | 181 | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int a = scan.nextInt(scan);
System.out.println(a);
}
}
|
s606176999 | p02256 | u260169299 | 1534868944 | Python | Python3 | py | Runtime Error | 0 | 0 | 432 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
scanner.close();
System.out.println(helper(a,b));
}
public int helper(int a, int b){
if(a ==0){
return b;
} else {
return helper(b % a, a);
}
}
}
|
s575889057 | p02256 | u260169299 | 1534868986 | Python | Python3 | py | Runtime Error | 0 | 0 | 439 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
scanner.close();
System.out.println(helper(a,b));
}
public static int helper(int a, int b){
if(a ==0){
return b;
} else {
return helper(b % a, a);
}
}
}
|
s118232932 | p02256 | u260169299 | 1534869942 | Python | Python3 | py | Runtime Error | 0 | 0 | 466 | import java.util.Scanner;
# gcd(x, y) = gcd(y, x%y)
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
scanner.close();
System.out.println(helper(a,b));
}
public static int helper(int a, int b){
if(b == 0){
return a;
} else {
return helper(b, b % a);
}
}
}
|
s703285265 | p02256 | u260169299 | 1534869968 | Python | Python3 | py | Runtime Error | 0 | 0 | 466 | import java.util.Scanner;
//gcd(x, y) = gcd(y, x%y)
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
scanner.close();
System.out.println(helper(a,b));
}
public static int helper(int a, int b){
if(b == 0){
return a;
} else {
return helper(b, b % a);
}
}
}
|
s793210857 | p02256 | u260169299 | 1535145155 | Python | Python3 | py | Runtime Error | 0 | 0 | 338 | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int x = input.nextInt();
int y = input.nextInt();
int out = helper(x,y);
System.out.println(out);
}
public static int helper(int x, int y){
if(y == 0){
return x;
} else if(x >= y){
return helper(y, x%y);
}
}
}
|
s881961344 | p02256 | u153772872 | 1535971593 | Python | Python3 | py | Runtime Error | 0 | 0 | 115 | x, y = map(int, input.()split())
if x < y:
swap(x, y)
while y > 0:
r = x % y
x = y
y = r
print(y)
|
s503282382 | p02256 | u498700706 | 1556157678 | Python | Python3 | py | Runtime Error | 0 | 0 | 31 | x = int(input())
print(x**3)
|
s785507925 | p02256 | u498700706 | 1556157737 | Python | Python3 | py | Runtime Error | 0 | 0 | 31 | x = int(input())
print(x**3)
|
s709753640 | p02256 | u498700706 | 1556157778 | Python | Python3 | py | Runtime Error | 0 | 0 | 31 | x = int(input())
print(x**3)
|
s059344426 | p02256 | u662822413 | 1559223412 | Python | Python3 | py | Runtime Error | 0 | 0 | 164 | def calc_gcd(a,b):
if a < b:
a,b=b,a
if b == a:
return a
return calc_gcd(b,a%b)
x,y=map(int,input().split())
print("%d"%(calc_(x,y)))
|
s324989848 | p02256 | u662822413 | 1559223448 | Python | Python3 | py | Runtime Error | 0 | 0 | 167 | def calc_gcd(a,b):
if a < b:
a,b=b,a
if b == a:
return a
return calc_gcd(b,a%b)
x,y=map(int,input().split())
print("%d"%(calc_gcd(x,y)))
|
s284992539 | p02256 | u535719732 | 1559377993 | Python | Python3 | py | Runtime Error | 0 | 0 | 208 | data = list(map(int,input().split()))
if(data[0] < data[1]): data[0],data[1] = data[1],data[0]
z = data[0] % data[1]
gcd = 0
for i in range(1,z):
if(z%i == 0 and y%i == 0 and gcd < i): gcd = i
print(gcd)
|
s997540542 | p02256 | u535719732 | 1559378778 | Python | Python3 | py | Runtime Error | 0 | 0 | 189 | data = list(map(int,input().split()))
if(data[0] < data[1]): data[0],data[1] = data[1],data[0]
z = data[0] % data[1]
def gcd(x,y):
return x if y == 0 else gcd(y,x%y)
else: print(gcd)
|
s153190079 | p02256 | u535719732 | 1559378803 | Python | Python3 | py | Runtime Error | 0 | 0 | 184 | data = list(map(int,input().split()))
if(data[0] < data[1]): data[0],data[1] = data[1],data[0]
def gcd(x,y):
return x if y == 0 else gcd(y,x%y)
else: print(gcd(data[0],data[1]))
|
s260478142 | p02256 | u844945939 | 1414401469 | Python | Python3 | py | Runtime Error | 0 | 0 | 81 | x, y = (int(s) for s in input().split())
while y > 0
x, y = y, x % y
print(x) |
s933788524 | p02256 | u507118101 | 1417233400 | Python | Python | py | Runtime Error | 170 | 43772 | 141 | a,b = map(int,raw_input().split(' '))
x = max(a,b)
n = min(a,b)
f = False
for i in range(n,0,-1):
if x%i == 0 and n %i==0:
print i
break |
s445787996 | p02256 | u580607517 | 1420897187 | Python | Python | py | Runtime Error | 120 | 43772 | 190 | def gcd(x, y):
n = min(x, y)
array = range(1, n + 1)
array.reverse()
for d in array:
if x % d == 0 and y % d == 0:
return d
a, b = map(int, raw_input().split(' '))
print gcd(a, b) |
s888926565 | p02256 | u777299405 | 1436074333 | Python | Python3 | py | Runtime Error | 0 | 0 | 70 | from fractions import gcd
x, y = int(input().split())
print(gcd(x, y)) |
s440699489 | p02256 | u802705119 | 1436852574 | Python | Python3 | py | Runtime Error | 30 | 6724 | 182 | x, y = [int(i) for i in input().split()]
if x < y:
buff = x
x = y
y = buff
r = x % y
for i in range(1, r):
if y % i == 0 and r % i == 0:
gcd = i
print(gcd) |
s201658528 | p02256 | u802705119 | 1436853566 | Python | Python3 | py | Runtime Error | 30 | 6724 | 182 | x, y = [int(i) for i in input().split()]
if x < y:
buff = x
x = y
y = buff
r = x % y
for i in range(1, r):
if y % i == 0 and r % i == 0:
gcd = i
print(gcd) |
s618463912 | p02256 | u802705119 | 1437104543 | Python | Python3 | py | Runtime Error | 40 | 6724 | 182 | x, y = [int(i) for i in input().split()]
if x < y:
buff = x
x = y
y = buff
r = x % y
for i in range(1, r):
if y % i == 0 and r % i == 0:
gcd = i
print(gcd) |
s122266697 | p02256 | u802705119 | 1437456615 | Python | Python3 | py | Runtime Error | 30 | 6720 | 186 | # GCD
x, y = [int(i) for i in input().split()]
if x < y:
buff = x
x = y
y = buff
r = x % y
for i in range(1, r+1):
if y % i == 0 and r % i == 0:
d = i
print(d) |
s274276012 | p02256 | u802705119 | 1437456640 | Python | Python3 | py | Runtime Error | 30 | 6724 | 186 | # GCD
x, y = [int(i) for i in input().split()]
if x < y:
buff = x
x = y
y = buff
r = x % y
for i in range(1, r+1):
if y % i == 0 and r % i == 0:
d = i
print(d) |
s352606283 | p02256 | u894381890 | 1442213856 | Python | Python | py | Runtime Error | 0 | 0 | 232 | import sys
import math
x = sys.stdin.readline()
a, b = x.split(" ")
a = int(a)
b = int(b)
y = 1
if a > b:
a,b = b,a
for i in range(2, a):
if a % i == 0 and b % i == 0:
y *= i
a = a / i
b = b / i
i--
print y |
s664321249 | p02256 | u729824721 | 1442213858 | Python | Python | py | Runtime Error | 0 | 0 | 294 | import sys
import math
for line in sys.stdin.readlines():
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, sort(x) + 1):
if x % i == 0 and y % i == 0:
divide *= i
x /= i
y /= i
i -= 1
print divide |
s970882366 | p02256 | u729824721 | 1442213909 | Python | Python | py | Runtime Error | 0 | 0 | 294 | import sys
import math
for line in sys.stdin.readlines():
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, sqrt(x) + 1):
if x % i == 0 and y % i == 0:
divide *= i
x /= i
y /= i
i -= 1
print divide |
s343441238 | p02256 | u729824721 | 1442213947 | Python | Python | py | Runtime Error | 0 | 0 | 299 | import sys
import math
for line in sys.stdin.readlines():
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, int(sqrt(x)) + 1):
if x % i == 0 and y % i == 0:
divide *= i
x /= i
y /= i
i -= 1
print divide |
s891895777 | p02256 | u729824721 | 1442213973 | Python | Python | py | Runtime Error | 10 | 6356 | 276 | import sys
for line in sys.stdin.readlines():
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, x + 1):
if x % i == 0 and y % i == 0:
divide *= i
x /= i
y /= i
i -= 1
print divide |
s250112431 | p02256 | u729824721 | 1442213991 | Python | Python | py | Runtime Error | 0 | 0 | 270 | import sys
line = sys.stdin.readline():
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, x + 1):
if x % i == 0 and y % i == 0:
divide *= i
x /= i
y /= i
i -= 1
print divide |
s849874446 | p02256 | u729824721 | 1442214019 | Python | Python | py | Runtime Error | 0 | 0 | 276 | import sys
line = sys.stdin.readline():
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, x + 1):
if x % i == 0 and y % i == 0:
divide *= i
x = x / i
y = y / i
i -= 1
print divide |
s734322641 | p02256 | u729824721 | 1442214029 | Python | Python | py | Runtime Error | 0 | 0 | 284 | import sys
line = sys.stdin.readline():
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, x + 1):
if x % i == 0 and y % i == 0:
divide = divide * i
x = x / i
y = y / i
i -= 1
print divide |
s696016265 | p02256 | u729824721 | 1442214041 | Python | Python | py | Runtime Error | 0 | 0 | 283 | import sys
line = sys.stdin.readline()
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, x + 1):
if x % i == 0 and y % i == 0:
divide = divide * i
x = x / i
y = y / i
i -= 1
print divide |
s275976907 | p02256 | u729824721 | 1442214171 | Python | Python | py | Runtime Error | 0 | 0 | 283 | import sys
line = sys.stdin.readline()
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
for i in range(2, x + 1):
if x % i == 0 and y % i == 0:
divide = divide * i
x = x / i
y = y / i
i -= 1
print divide |
s868063962 | p02256 | u253463900 | 1442214329 | Python | Python3 | py | Runtime Error | 0 | 0 | 143 | s = input()
x,y = map(int,s)
while(x != y or x!=1 or y != 1)
if(x < y):
tmp = x
x = y
y = tmp
x %= y
print(x) |
s873957654 | p02256 | u729824721 | 1442280534 | Python | Python | py | Runtime Error | 30 | 45744 | 385 | import sys
line = sys.stdin.readline()
x, y = line.split(" ")
x = int(x)
y = int(y)
divide = 1
if x > y:
x, y = y, x
while(1):
flag = 0
for i in range(2, x + 1):
if x % i == 0 and y % i == 0:
divide = divide * i
x = x / i
y = y / i
flag = 1
break
if flag == 0:
print divide
exit() |
s159814784 | p02256 | u421942904 | 1449392982 | Python | Python | py | Runtime Error | 10 | 6296 | 255 | import sys
for i in sys.stdin:
lst = i.split(' ')
n = 1
while n <= lst[0]:
lst = map(int, lst)
if lst[0]%n == 0 and lst[1]%(lst[0]/n) == 0:
print lst[0]/n
break
n = n+1
else:
print 1 |
s648873834 | p02256 | u421942904 | 1449903270 | Python | Python | py | Runtime Error | 0 | 0 | 639 | # -*- coding: euc-jp -*-
import sys
# ?????????
for i in sys.stdin:
# ????????§???????????????2????????°?????????????????????????????????
lst = i.split(' ')
lst = map(int, lst)
lst.sort()
# 1????????????????°???????????????°???/2?????§??°?????????
n = 1
while n <= lst[0]/2:
# ???????????????????????°???????????????????????????
if lst[0]%n == 0 and lst[1]%(lst[0]/n) == 0:
print lst[0]/n
break
n = n+1
else:
print 1
sys.exit(0) |
s967346340 | p02256 | u421942904 | 1449903371 | Python | Python | py | Runtime Error | 0 | 0 | 639 | # -*- coding: euc-jp -*-
import sys
# ?????????
for i in sys.stdin:
# ????????§???????????????2????????°?????????????????????????????????
lst = i.split(' ')
lst = map(int, lst)
lst.sort()
# 1????????????????°???????????????°???/2?????§??°?????????
n = 1
while n <= lst[0]/2:
# ???????????????????????°???????????????????????????
if lst[0]%n == 0 and lst[1]%(lst[0]/n) == 0:
print lst[0]/n
break
n = n+1
else:
print 1
sys.exit(0) |
s172059578 | p02256 | u321017034 | 1453386578 | Python | Python3 | py | Runtime Error | 20 | 7676 | 424 | def gcd(x, y):
a_x = list()
a_y = list()
for i in range(1, x+1):
if x % i == 0:
a_x.append(i)
for i in range(1, y+1):
if y % i == 0:
a_y.append(i)
a_cd = list(set(a_x).intersection(set(a_y)))
return max(a_cd)
if __name__ == "__main__":
x, y = map(int, input().split())
if x > y:
tmp = x
x = y
y = tmp
print(gcd(x, y%x)) |
s215547948 | p02256 | u994049982 | 1458604385 | Python | Python | py | Runtime Error | 0 | 0 | 79 | a=map(int,raw_input().split())
a.sort()
while a[1]%a[0]!=0:
a,b=b%a,a
return a |
s623323451 | p02256 | u994049982 | 1458604422 | Python | Python | py | Runtime Error | 0 | 0 | 97 | a=map(int,raw_input().split())
a.sort()
while a[1]%a[0]!=0:
a[0],a[1]=a[1]%a[0],a[0]
return a[0] |
s268514012 | p02256 | u231136358 | 1471773882 | Python | Python3 | py | Runtime Error | 0 | 0 | 310 | import math
(a, b) = tuple([int(s) for s in input().split()])
if a==b:
print(a)
return
min = a if a < b else b
divisor = 1
i = 2
while i < math.sqrt(min):
if a % i == 0 and b % i == 0:
a = a / i
b = b / i
divisor = divisor * i
else:
i = i + 1
print(divisor) |
s659351315 | p02256 | u500396695 | 1476711224 | Python | Python3 | py | Runtime Error | 0 | 0 | 55 | while x > 0:
z = x
x = y % x
y = z
print(y) |
s942158118 | p02256 | u831244171 | 1477796432 | Python | Python | py | Runtime Error | 40 | 45908 | 285 | x,y = map(int,raw_input().split())
cd = 1
while True:
a = x
for i in range(2,int(min(x,y)) + 1):
if x%i == 0:
if y%i == 0:
x /= i
y /= i
cd *= i
break
if a == x:
break
print(cd)
|
s921847075 | p02256 | u831244171 | 1477797415 | Python | Python | py | Runtime Error | 0 | 0 | 195 | import time
x,y = map(int,input().split())
b = int(min(x,y))
a = int(max(x,y))
def gcd(a,b):
if a % b != 0:
r = a % b
return gcd(b,r)
else:
print(b)
gcd(a,b)
|
s936950374 | p02256 | u922871577 | 1478933954 | Python | Python | py | Runtime Error | 0 | 0 | 66 | from fractions import gcd
print gcd(*map(int, raw_input().split()) |
s749906362 | p02256 | u742013327 | 1479194036 | Python | Python3 | py | Runtime Error | 0 | 0 | 485 | #http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_B&lang=jp
#??????????????????????????????
#?????§??¬?´???°???????????????????????????????????¨????????¨?¨????????????????
def gcd(x,y):
tmp = y
if y > x:
y = x
x = tmp
while not y == 0:
y = x % y
x = tmp
tmp = y
return x
def main():
target = [int(a) for a in input().split()]
print(gcd(a[0], a[1]))
if __name__ == "__main__":
main() |
s787684915 | p02256 | u811733736 | 1480426613 | Python | Python3 | py | Runtime Error | 0 | 0 | 391 | def calc_gcd(a, b):
from math import gcd
return gcd(a, b)
if __name__ == '__main__':
# ??????????????¬?????¨
# start_time = datetime.now()
# print('>>> {0}'.format(start_time))
# ???????????\???
data = [int(x) for x in input().split(' ')]
# ?¨?????????????
result = calc_gcd(data[0], data[1])
# ???????????¨???
print('{0}'.format(result)) |
s729125099 | p02256 | u811733736 | 1480426679 | Python | Python3 | py | Runtime Error | 0 | 0 | 387 | def calc_gcd(a, b):
import math
return math.gcd(a, b)
if __name__ == '__main__':
# ??????????????¬?????¨
# start_time = datetime.now()
# print('>>> {0}'.format(start_time))
# ???????????\???
data = [int(x) for x in input().split(' ')]
# ?¨?????????????
result = calc_gcd(data[0], data[1])
# ???????????¨???
print('{0}'.format(result)) |
s033419746 | p02256 | u811733736 | 1480426712 | Python | Python3 | py | Runtime Error | 0 | 0 | 385 | import math
def calc_gcd(a, b):
return math.gcd(a, b)
if __name__ == '__main__':
# ??????????????¬?????¨
# start_time = datetime.now()
# print('>>> {0}'.format(start_time))
# ???????????\???
data = [int(x) for x in input().split(' ')]
# ?¨?????????????
result = calc_gcd(data[0], data[1])
# ???????????¨???
print('{0}'.format(result)) |
s671059754 | p02256 | u811733736 | 1480427549 | Python | Python3 | py | Runtime Error | 0 | 0 | 214 | def calc_gcd(a, b):
from math import gcd
return gcd(a, b)
if __name__ == '__main__':
data = [int(x) for x in input().split(' ')]
result = calc_gcd(data[0], data[1])
print('{0}'.format(result)) |
s017342121 | p02256 | u811733736 | 1480429875 | Python | Python3 | py | Runtime Error | 0 | 0 | 214 | def calc_gcd(a, b):
from math import gcd
return gcd(a, b)
if __name__ == '__main__':
data = [int(x) for x in input().split(' ')]
result = calc_gcd(data[0], data[1])
print('{0}'.format(result)) |
s237768401 | p02256 | u923668099 | 1482621296 | Python | Python3 | py | Runtime Error | 0 | 0 | 63 | import math
a,b = map(int,input().split())
print(math.gcd(a,b)) |
s180093388 | p02256 | u546285759 | 1483679704 | Python | Python3 | py | Runtime Error | 0 | 0 | 70 | from math import gcd
x, y = map(int, input().split())
print(gcd(x, y)) |
s375725354 | p02256 | u546285759 | 1483679757 | Python | Python3 | py | Runtime Error | 0 | 0 | 70 | from math import gcd
x, y = map(int, input().split())
print(gcd(x, y)) |
s930683112 | p02256 | u852745524 | 1483944318 | Python | Python3 | py | Runtime Error | 0 | 0 | 305 | a=int(input("a:"))
b=int(input("b:"))
# a=max(a, b)
# b=min(a, b)?????¨??????????????????????????????
# ???????????????????????????a1=30, b1=100??????a2=b1=100, b2=r1=30??¨???????????§?°???\???????????????
while True:
r=a%b
if r==0:
break
else:
a=b
b=r
print(b) |
s990680304 | p02256 | u656153606 | 1485044810 | Python | Python3 | py | Runtime Error | 20 | 7700 | 195 | x, y = [int(i) for i in input().split()]
if x < y:
a = x
x = y
y = a
for i in range(int(x%y/2)):
if (x%y)% (i+1) == 0 and y%(i+1) == 0:
kouyakusu = i+1
print(kouyakusu) |
s042863331 | p02256 | u162598098 | 1485420437 | Python | Python3 | py | Runtime Error | 0 | 0 | 82 | def gcd(a, b):
while b:
a, b = b, a % b
return a
x,y=input().split()
gcd(x,y) |
s016947653 | p02256 | u519227872 | 1486565229 | Python | Python3 | py | Runtime Error | 0 | 0 | 121 | x, y = map(int,input().split())
while True
if x >= y:
x %= y
else
y %= x
if x == y:
print(x)
break |
s883174193 | p02256 | u144068724 | 1487082604 | Python | Python3 | py | Runtime Error | 0 | 0 | 64 | import math
x,y = map(int,input().split())
print(math.gcd(x,y)) |
s700175194 | p02256 | u144068724 | 1487082654 | Python | Python3 | py | Runtime Error | 0 | 0 | 64 | import math
x,y = map(int,input().split())
print(math.gcd(x,y)) |
s533278665 | p02256 | u825178626 | 1489140249 | Python | Python3 | py | Runtime Error | 20 | 7596 | 198 | # coding: utf-8
# Here your code !
def mcg(a,b):
while a%b !=0:
x = a%b
a = b
b = x
return x
num =sorted(list(map(int,input().split(" "))))
print(mcg(num[0],num[1])) |
s349691708 | p02256 | u868716420 | 1490822387 | Python | Python3 | py | Runtime Error | 0 | 0 | 82 | from math import gcd
a, b = [int(tem) for tem in input().split()]
print(gcd(a, b)) |
s408120363 | p02256 | u868716420 | 1490822454 | Python | Python3 | py | Runtime Error | 0 | 0 | 87 | from math import gcd
a, b = [int(tem) for tem in input().split()]
print(str(gcd(a, b))) |
s346840710 | p02256 | u868716420 | 1490906539 | Python | Python3 | py | Runtime Error | 0 | 0 | 103 | from math import gcd
a, b = [int(tem) for tem in input().split()]
A = str(gcd(a, b))
print(A.strip('')) |
s969509367 | p02256 | u286589639 | 1493084911 | Python | Python3 | py | Runtime Error | 0 | 0 | 66 | import math
x, y = map(int, input().split())
print(math.gcd(x, y)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.