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
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s588403159
p02256
u735204496
1498976320
Python
Python
py
Accepted
10
6428
293
import sys def get_gcd(x, y): if (x % y == 0) or (y % x == 0): return min(x, y) return get_gcd((max(x, y) % min(x, y)), min(x, y)) if __name__ == "__main__": array = map(lambda x: int(x), sys.stdin.readline().strip().split(" ")) print get_gcd(array[0], array[1])
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,982
s212522800
p02256
u490583481
1499692818
Python
Python
py
Accepted
10
6436
139
def gcd(x, y): while y != 0: temp = x % y x = y y = temp print x l = map(int, raw_input().split()) gcd(*l)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,983
s626998046
p02256
u193453446
1499842861
Python
Python3
py
Accepted
20
7684
612
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ?????§??¬?´???° ??????????????¶??° x, y ?????\?????¨???????????????????????§??¬?´???°????±???????????????°???????????????????????????????????? ????????? ??´??° x, y ???????????????x ??\ y ????????° x ??¨ y ????????§??¬?´???°??? y ??¨ x % y ????????§??¬?´???°???????????...
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,984
s626107880
p02256
u264972437
1500210539
Python
Python3
py
Accepted
20
7628
79
y,x = sorted([int(s) for s in input().split()]) while y: x,y = y,x%y print(x)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,985
s011438182
p02256
u956645355
1500260241
Python
Python3
py
Accepted
40
7672
237
def main(): X, Y = map(int, input().split()) print(gcd(X, Y)) def gcd(a, b): if a < b: a, b = b, a r = a % b if r == 0: return b else: a = b b = r return gcd(a, b) main()
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,986
s019045918
p02256
u072053884
1500344449
Python
Python3
py
Accepted
20
7700
186
# Euclidean algorithm def gcd(x, y): if x < y: x, y = y, x while y > 0: r = x % y x = y y = r return x print(gcd(*map(int, input().split())))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,987
s922634108
p02256
u914146430
1500538142
Python
Python3
py
Accepted
20
7700
149
def euclidean_alg(x,y): while y: x,y=y,x%y return x XY=list(map(int,input().split())) x=max(XY) y=min(XY) print(euclidean_alg(x,y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,988
s757066119
p02256
u260980560
1501610055
Python
Python3
py
Accepted
20
7700
100
def gcd(m, n): r = m % n return gcd(n, r) if r else n print(gcd(*map(int, input().split())))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,989
s970755647
p02256
u491916705
1502079371
Python
Python
py
Accepted
10
6428
190
x, y = map(int, raw_input().split()) if x < y: tmp = y y = x x = tmp while 1: tmp = x % y x = y y = tmp if tmp == 0: tmp = x break print tmp
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,990
s073745819
p02256
u350064373
1502593780
Python
Python3
py
Accepted
20
7704
99
def gcd(a, b): while b: a, b = b, a%b return a x, y = map(int,input().split()) print(gcd(x, y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,991
s601270490
p02256
u614197626
1503048644
Python
Python3
py
Accepted
20
7652
129
x, y = map(int, input().split()) while (1): tmp = y y = x % tmp x = tmp if (y==0): print(x) break
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,992
s933273550
p02256
u957021183
1503146141
Python
Python3
py
Accepted
20
7784
336
# Aizu Problem ALDS_1_1_B: Greatest Common Divisor # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input2.txt", "rt") def gcd(a, b): while b != 0: t = b b = a % b a = t return a x, y = [int(_) for _ in input().split()] ...
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,993
s050811325
p02256
u283452598
1503217372
Python
Python3
py
Accepted
30
7700
144
def division(x,y): if y == 0: return x return division(y, x%y) x,y=map(int,input().split()) kotae = division(x,y) print(kotae)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,994
s513011232
p02256
u821624310
1503307930
Python
Python3
py
Accepted
30
7640
122
def gcd(x, y): if y == 0: return x return gcd(y, x % y) x, y = map(int, input().split()) print(gcd(x, y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,995
s074610334
p02256
u853619096
1503799360
Python
Python3
py
Accepted
20
7676
244
z=list(map(int,input().split())) z.sort() a=0 while True: if z[1]==z[0]: break a=z[1]-z[0] if z[0]%a==0: z[1] = z[0] z[0] = a z.sort() break z[1]=z[0] z[0]=a z.sort() print(z[0])
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,996
s518677520
p02256
u510829608
1504184768
Python
Python3
py
Accepted
20
7628
112
def gcm(x,y): while y: x, y = y, x % y return x a,b = map(int, input().split()) print(gcm(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,997
s809456010
p02256
u343251190
1505032599
Python
Python3
py
Accepted
60
7696
129
a, b = map(int, input().split()) x, y = max(a, b), min(a, b) while 1: if x%y == 0: break x, y = y, x%y print(y)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,998
s174111906
p02256
u354053070
1505107105
Python
Python3
py
Accepted
20
7768
153
def gcd(x, y): if x < y: x, y = y, x while y > 0: x, y = y, x % y return x x, y = map(int, input().split()) print(gcd(x, y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
31,999
s986565438
p02256
u972637506
1505792558
Python
Python3
py
Accepted
70
10200
81
from fractions import gcd a, b = list(map(int, input().split())) print(gcd(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,000
s463177752
p02256
u146816547
1506136945
Python
Python
py
Accepted
10
6444
139
def gcd(x, y): if y == 0: return x else: return gcd(y, x%y) x, y = map(int, raw_input().split()) print gcd(x, y)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,001
s839177956
p02256
u600821328
1506148268
Python
Python3
py
Accepted
20
7756
217
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def gcd(a, b): if b == 0: return a return gcd(b, a % b) def main(): X, Y = map(int, input().split()) print(gcd(X,Y)) if __name__ == "__main__": main()
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,002
s738857356
p02256
u071759777
1506234545
Python
Python3
py
Accepted
20
7764
78
a, b = [int(x) for x in input().split()] while b: a, b = b, a % b print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,003
s109340462
p02256
u633333374
1506487040
Python
Python
py
Accepted
30
6440
126
def gcd(a,b): if a < b: a,b = b,a while b != 0: a,b = b,a%b return a a,b = map(int,raw_input().split()) print gcd(a,b)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,004
s633654036
p02256
u218655931
1506574147
Python
Python3
py
Accepted
20
7764
196
import sys a1,b1 = list(map(int,input().split())) def gcd(a,b): if(b == 0): return a else: c = b b = a%b a = c return(gcd(a,b)) print(gcd(a1,b1))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,005
s967647937
p02256
u024715419
1507259734
Python
Python3
py
Accepted
30
7712
83
a = input().split() x = int(a[0]) y = int(a[1]) while y: x, y = y, x%y print(x)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,006
s942951931
p02256
u024715419
1507260272
Python
Python3
py
Accepted
30
7696
83
a = input().split() x = int(a[0]) y = int(a[1]) while y: x, y = y, x%y print(x)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,007
s765526553
p02256
u450231931
1507297218
Python
Python3
py
Accepted
50
7716
333
num = input().split() if int(num[0])<int(num[1]): x = int(num[1]) y = int(num[0]) else: x = int(num[0]) y = int(num[1]) end = 0 z = x % y if z == 0: print(y) else: while True: z1 = y % z y1 = z if z1 == 0: print(z) break z = z1 ...
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,008
s591210121
p02256
u792145349
1507513483
Python
Python3
py
Accepted
20
7772
167
a, b = map(int, input().split()) def GCD(a,b): x = max(a,b) y = min(a,b) while y : x, y = y, x % y return x print(GCD(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,009
s612154872
p02256
u957840591
1507540554
Python
Python3
py
Accepted
20
7752
213
def Euclid(max, min): if max % min == 0: return min else: return Euclid(min, max % min) a, b = map(int, input().split(" ")) if a > b: print(Euclid(a, b)) else: print(Euclid(b, a))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,010
s178683298
p02256
u742466022
1507689537
Python
Python3
py
Accepted
20
7756
172
def gcd(a, b): while b: a, b = b, a % b return a def lcm(a, b): return a * b // gcd (a, b) c,d=[int(i) for i in input().split()] print(gcd(c,d))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,011
s054805424
p02256
u688488162
1507899591
Python
Python3
py
Accepted
20
7708
121
x,y = list(map(int,input().split())) if x < y: x,y = y,x while y>0: r = x % y x = y y = r print(x)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,012
s941307326
p02256
u480053997
1508137798
Python
Python3
py
Accepted
50
7696
75
x, y = map(int, input().split()) while y > 0: x, y = y , x % y print(x)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,013
s701683852
p02256
u576398884
1508199660
Python
Python3
py
Accepted
30
7756
175
def gcd(x, y): if x < y: return gcd(y, x) if x%y == 0: return y else: return gcd(y, x%y) a, b = map(int, input().split()) print(gcd(a, b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,014
s599763214
p02256
u998851054
1508318588
Python
Python3
py
Accepted
50
7752
148
def getResult(a,b): if a<b: a,b=b,a while b!=0: r = a%b a = b b = r return a a,b = map(int,input().strip().split()) print(getResult(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,015
s308025195
p02256
u568287817
1508658949
Python
Python3
py
Accepted
40
7696
276
def swap(x, y): tmp = x x = y y = tmp def gcm(x, y): if x < y: swap(x, y) while y > 0: r = x % y x = y y = r return x if __name__ == '__main__': x, y = list(map(int, input().split())) n = gcm(x, y) print(n)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,016
s758199399
p02256
u626266743
1508852678
Python
Python3
py
Accepted
20
7680
75
x, y = map(int, input().split()) while y > 0 : x, y = y, x % y print(x)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,017
s715555690
p02256
u424457654
1508897010
Python
Python3
py
Accepted
20
7712
178
x, y = map(int, input().split()) while True: if x >= y: x = x % y else: y = y % x if x % y == 0: print(y) break elif y % x == 0: print(x) break
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,018
s000182260
p02256
u110907458
1509266500
Python
Python3
py
Accepted
70
7792
142
x , y = map(int,input().split()) def GCD(x,y): while y > 0: x ,y = y , x %y else: return x ans = GCD(x,y) print(ans)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,019
s646648717
p02256
u043968625
1509279714
Python
Python3
py
Accepted
40
7784
215
a, b = [int(i) for i in input().split()] z = 0 def gcd(x,y): if x<y: z=x x=y y=z while x%y !=0: z=x%y x=y y=z gcd(x,y) return y print(gcd(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,020
s178140163
p02256
u846136461
1509960837
Python
Python
py
Accepted
10
6448
157
num = map(int, raw_input().split()) if num[0] > num[1]: x = num[0] y = num[1] else: y = num[0] x = num[1] while y > 0: z = x % y x = y y = z print x
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,021
s187324185
p02256
u933096856
1510305643
Python
Python3
py
Accepted
60
7656
97
a,b=sorted(list(map(int, input().split()))) m=b%a while m>=1: b=a a=m m=b%a print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,022
s397467738
p02256
u776758454
1510323162
Python
Python3
py
Accepted
20
7700
141
def main(): x,y = map(int, input().split()) while y != 0: if x < y: x, y = y, x x, y = y, x % y print(x) main()
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,023
s269374967
p02256
u409699893
1510888884
Python
Python3
py
Accepted
20
7712
140
a,b = list(map(int,input().split())) while 1: if a < b: a,b = b,a a,b =b, a % b if b == 0: break print (a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,024
s345978923
p02256
u433154529
1510976568
Python
Python3
py
Accepted
20
7760
117
a,b=[int(i) for i in input().split(" ")] while b!=0: t = min(a,b) b = max(a,b) % min(a,b) a = t print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,025
s712996021
p02256
u045830275
1511357451
Python
Python3
py
Accepted
30
7760
152
def main() : x, y = [int(d) for d in input().split()] while y != 0 : x, y = y, x%y print(x) if __name__ == '__main__' : main()
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,026
s989797619
p02256
u865281338
1511358902
Python
Python3
py
Accepted
60
7752
151
def main() : x, y = [int(i) for i in input().split()] while y != 0 : x, y = y, x%y print(x) if __name__ == '__main__': main()
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,027
s237170618
p02256
u747709646
1511426595
Python
Python3
py
Accepted
40
7736
413
dbg = False a, b = list(map(int, input().split())) if a > b: x, y = a, b else: x, y = b, a divs = [1] for i in range(1, int((y+1)/2)+1): gcd_tmp = int(y / i) if dbg: print('%d, %d' % (i, gcd_tmp)) if i > gcd_tmp: break if y % i == 0: if x % gcd_tmp == 0: print(gcd_...
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,028
s235204495
p02256
u928329738
1511967202
Python
Python3
py
Accepted
20
5600
158
def gcd(a,b): if b == 1: return 1 else: return (gcd(b,a%b) if b != 0 else a) A = list(map(int,input().split())) print(gcd(A[0],A[1]))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,029
s958338045
p02256
u500386459
1512108243
Python
Python3
py
Accepted
20
5600
235
def gcd(a, b): if a < b: tmp = a a = b b = tmp r = a % b while r != 0: a = b b = r r = a % b return b if __name__ == '__main__': l = list(map(int, input().split())) x = l[0] y = l[1] ans = gcd(x, y) print(ans)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,030
s427729123
p02256
u424041287
1512112123
Python
Python3
py
Accepted
20
5604
191
def gcd(X,Y): x = X y = Y if y > x: x,y = y,x while x % y: x,y = y,x%y return y number = [int(i) for i in input().split()] print(gcd(number[0],number[1]))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,031
s866493496
p02256
u488038316
1512233354
Python
Python3
py
Accepted
20
5600
256
def main(): x, y = map(int, input().split()) print(gcd(x, y)) def gcd(x, y): if(x < y): x, y = y, x while True: if(y == 0): return x else: x, y = y, x%y if __name__ == '__main__': main()
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,032
s517912548
p02256
u908984540
1512716447
Python
Python3
py
Accepted
20
5600
274
def greatest_common_divisor(x, y): if x < y: x, y = y, x if y == 0: return x else: return greatest_common_divisor(y, x % y) if __name__ == '__main__': x, y = [int(x) for x in input().split()] print(greatest_common_divisor(x, y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,033
s941451139
p02256
u255925718
1513333670
Python
Python
py
Accepted
10
4648
204
N=raw_input() N = [int(i) for i in N.split()] m,n = (N[1],N[0]) if N[1] > N[0] else (N[0],N[1]) def gcd(m, n): if ((m % n) == 0): return n else: return gcd(n, m % n) print gcd(m,n)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,034
s029513468
p02256
u183079216
1513340182
Python
Python3
py
Accepted
20
5604
134
a,b=[int(x) for x in input().split()] x = max(a,b) y = min(a,b) res = y while x%y>0: res = x%y x = y y = res print(res)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,035
s051031063
p02256
u150984829
1513672725
Python
Python3
py
Accepted
20
5604
97
def g(n): x,y=n r=x%y if r>0:g((y,r)) else:print(y) g(sorted(list(map(int,input().split()))))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,036
s405326879
p02256
u146752763
1513679559
Python
Python
py
Accepted
10
4648
154
# coding:utf-8 def gcd(a,b): while b: a, b = b, a % b return a n = map(int, raw_input().split()) n.sort(reverse=True) print gcd(n[0],n[1])
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,037
s491745251
p02256
u810198868
1513733959
Python
Python3
py
Accepted
20
5604
398
ab = [int(x) for x in input().split()] # Naive Algorithm # m = min(ab) # gcd = 1 # for i in range(2, int(m/2)): # if ab[0] % i == 0 and ab[1] % i == 0: # gcd = i # print(gcd) # Euclidean Algorithm while True: min_i = ab.index(min(ab)) max_i = ab.index(max(ab)) r = ab[max_i] % ab[min_i] if ...
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,038
s546624742
p02256
u150984829
1513761058
Python
Python3
py
Accepted
10
5664
240
import math a,b=map(int,input().split()) print(math.gcd(a,b)) ''' # 09.98 sec 13492 KB 4 lines 99 bytes # Time Limit Exceeded n=int(input()) r=[int(input())for _ in range(n)] print(max([max(r[i+1:])-r[i]for i in range(n-1)])) '''
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,039
s138861190
p02256
u150984829
1513761232
Python
Python3
py
Accepted
20
5588
55
a,b=map(int,input().split()) while b:a,b=b,a%b print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,040
s410661358
p02256
u150984829
1513761293
Python
Python3
py
Accepted
20
5664
173
import math a,b=map(int,input().split()) print(math.gcd(a,b)) ''' # 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) '''
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,041
s964974465
p02256
u150984829
1513761301
Python
Python3
py
Accepted
30
5664
173
import math a,b=map(int,input().split()) print(math.gcd(a,b)) ''' # 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) '''
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,042
s861117683
p02256
u150984829
1513761346
Python
Python3
py
Accepted
30
5664
173
import math a,b=map(int,input().split()) print(math.gcd(a,b)) ''' # 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) '''
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,043
s636590151
p02256
u150984829
1513761430
Python
Python3
py
Accepted
20
5664
173
import math a,b=map(int,input().split()) print(math.gcd(a,b)) ''' # 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) '''
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,044
s526500593
p02256
u150984829
1513761433
Python
Python3
py
Accepted
20
5664
173
import math a,b=map(int,input().split()) print(math.gcd(a,b)) ''' # 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) '''
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,045
s144678901
p02256
u150984829
1513761436
Python
Python3
py
Accepted
20
5664
173
import math a,b=map(int,input().split()) print(math.gcd(a,b)) ''' # 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) '''
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,046
s948582916
p02256
u150984829
1513761455
Python
Python3
py
Accepted
20
5652
171
import math a,b=map(int,input().split()) print(math.gcd(a,b)) # 00.02 sec 5588 KB 4 lines 55 bytes # a,b=map(int,input().split()) # while b:a,b=b,a%b # print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,047
s088515771
p02256
u150984829
1513761459
Python
Python3
py
Accepted
20
5652
171
import math a,b=map(int,input().split()) print(math.gcd(a,b)) # 00.02 sec 5588 KB 4 lines 55 bytes # a,b=map(int,input().split()) # while b:a,b=b,a%b # print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,048
s026842603
p02256
u150984829
1513761506
Python
Python3
py
Accepted
20
5652
171
# 00.02 sec 5588 KB 4 lines 55 bytes # a,b=map(int,input().split()) # while b:a,b=b,a%b # print(a) import math a,b=map(int,input().split()) print(math.gcd(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,049
s171099735
p02256
u150984829
1513761620
Python
Python3
py
Accepted
20
5664
170
''' 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) ''' import math a,b=map(int,input().split()) print(math.gcd(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,050
s869988986
p02256
u150984829
1513761696
Python
Python3
py
Accepted
20
5660
173
''' # 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) ''' import math a,b=map(int,input().split()) print(math.gcd(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,051
s316963122
p02256
u150984829
1513761854
Python
Python3
py
Accepted
20
5664
173
''' # 00.02 sec 5588 KB 4 lines 55 bytes a,b=map(int,input().split()) while b:a,b=b,a%b print(a) ''' import math a,b=map(int,input().split()) print(math.gcd(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,052
s533792326
p02256
u406002631
1514039082
Python
Python3
py
Accepted
20
5596
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))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,053
s768465442
p02256
u409571842
1514125086
Python
Python3
py
Accepted
20
5608
275
#coding: UTF-8 import sys class Algo: @staticmethod def greatest_common_divisor(x, y): while True: r = x%y if r==0: print(y) break x, y = y, r l = list(map(int, input().split())) X = l[0] Y = l[1] Algo.greatest_common_divisor(X, Y)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,054
s948374321
p02256
u741801763
1514383806
Python
Python3
py
Accepted
20
5600
130
x,y = list(map(int,input().split())) ###??????x >= y if y>x:x,y = y,x while x % y !=0: x = x%y if y>x:x,y = y,x print(y)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,055
s602105416
p02256
u585035894
1514528159
Python
Python3
py
Accepted
20
5604
123
def gcd(x, y): if x % y != 0: return gcd(y, x % y) return y print(gcd(*[int(i) for i in input().split()]))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,056
s047485640
p02256
u972731768
1514550829
Python
Python3
py
Accepted
20
5600
100
A = list(map(int,input().split())) a=A[0] b=A[1] if a<b: a,b=b,a while b: a,b=b,a%b print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,057
s917204801
p02256
u972731768
1514551691
Python
Python3
py
Accepted
20
5596
80
A = list(map(int,input().split())) a=A[0] b=A[1] while b: a,b=b,a%b print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,058
s429014580
p02256
u972731768
1514551729
Python
Python3
py
Accepted
20
5596
84
A = list(map(int,input().split())) a=A[0] b=A[1] while b: a, b = b, a%b print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,059
s335895592
p02256
u009288816
1515074030
Python
Python
py
Accepted
10
4648
192
def gcd(a,b): if(b): return gcd(b,a%b) return a l = raw_input().split() if(int(l[0]) > int(l[1])): print gcd(int(l[0]),int(l[1])) else: print gcd(int(l[1]),int(l[0]))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,060
s589133663
p02256
u841567836
1515209420
Python
Python3
py
Accepted
20
5600
208
if __name__ == '__main__': a, b = input().split() a, b = int(a), int(b) if a < b: x = b y = a else: x = a y = b while True: x, y= y, x % y if y == 0: print(x) break else: continue
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,061
s032026071
p02256
u874332113
1515404858
Python
Python3
py
Accepted
20
5596
187
x, y = map(int, input().split()) l = max(x, y) s = min(x, y) for i in range(x): olds = s oldl = l s = oldl % olds l = olds if s == 0: print(l) break
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,062
s389161408
p02256
u802537549
1515912674
Python
Python3
py
Accepted
20
5600
142
def gcd(x, y): if x % y == 0: return y else: return gcd(y, x % y) x, y = map(int, input().split()) print(gcd(x, y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,063
s015774650
p02256
u839008951
1516106683
Python
Python3
py
Accepted
20
5600
158
a, b = list(map(int, input().split())) if a < b: a, b = b, a while True: if b == 0: break tmp = a % b a = b b = tmp print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,064
s220401132
p02256
u426534722
1516201600
Python
Python3
py
Accepted
20
5652
58
from math import * print(gcd(*map(int, input().split())))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,065
s610253104
p02256
u150984829
1516455404
Python
Python3
py
Accepted
20
5588
56
a,b=map(int,input().split()) while b:a,b=b,a%b print(a)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,066
s491701619
p02256
u150984829
1516455624
Python
Python3
py
Accepted
20
5648
55
import math print(math.gcd(*map(int,input().split())))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,067
s831188512
p02256
u227984374
1516601758
Python
Python3
py
Accepted
30
5596
144
x, y = map(int, input().split()) if x > y : pass else : x, y = y, x while x % y != 0 : d = x % y x = y y = d print(y)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,068
s854982445
p02256
u749243807
1516861016
Python
Python3
py
Accepted
20
5604
166
data = [int(n) for n in input().split(" ")]; def gcd(m, n): m = m % n; if m == 0: return n; return gcd(n, m); print(gcd(max(data), min(data)));
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,069
s959336140
p02256
u267728784
1517158691
Python
Python3
py
Accepted
20
5604
189
def gcm(a, b): if a % b == 0: return b else: return gcm(b, a % b) if __name__ == '__main__': [a, b] = [int(x) for x in input().split()] print(gcm(a,b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,070
s974411430
p02256
u088372268
1517530799
Python
Python3
py
Accepted
20
5600
159
def gcd(x, y): if x < y: x, y = y, x while y > 0: x, y = y, x%y return x x, y = list(map(int, input().split())) print(gcd(x, y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,071
s754750423
p02256
u536089081
1517533140
Python
Python3
py
Accepted
20
5652
71
from math import gcd a, b = map(int, input().split()) print(gcd(a, b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,072
s844453522
p02256
u650712316
1517555449
Python
Python3
py
Accepted
20
5596
144
s = input().split() A = int(s[0]) B = int(s[1]) if A < B: v = B B = A A = v R = A % B while R !=0: A = B B = R R = A % B print(B)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,073
s673601786
p02256
u770698847
1517557114
Python
Python
py
Accepted
10
4664
497
# coding: UTF-8 def euclidean_algorithm(x,y): if x > y: p = y r = x%y while r != 0: a = p b = r p = b r = a%b return p elif x == y: return x elif x < y: p = x r = y%x while r != 0: a =...
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,074
s892538270
p02256
u177808190
1517573913
Python
Python3
py
Accepted
30
5604
246
def gcd(x, y): if x < y: tmp = x x = y y = tmp while y > 0: r = x % y x = y y = r return x if __name__ == '__main__': a, b = [int(x) for x in input().split()] print (gcd(a, b))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,075
s788312217
p02256
u471400255
1517760457
Python
Python3
py
Accepted
20
5664
78
from math import gcd x,y = [int(i) for i in input().split()] print(gcd(x,y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,076
s980320161
p02256
u197670577
1518051289
Python
Python
py
Accepted
10
4636
123
# coding; utf-8 a, b = map(int, raw_input().split()) if a < b: a, b = b, a while b != 0: a, b = b, a % b print a
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,077
s609218670
p02256
u238001675
1518580964
Python
Python3
py
Accepted
20
5608
186
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys def gcd(x, y): while y: x, y = y, x % y return x x, y = map(int, sys.stdin.readline().split()) print(gcd(x, y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,078
s604690947
p02256
u608789460
1518804259
Python
Python3
py
Accepted
20
5596
158
inp=sorted(list(map(int,input().split()))) while inp[1]>=inp[0]: a=inp[1]%inp[0] if a==0: break inp[1]=inp[0] inp[0]=a print(inp[0])
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,079
s808810356
p02256
u294922877
1519014397
Python
Python3
py
Accepted
20
5600
308
def greatest_common_divisor(x, y): while True: if x == 0 or y == 0: break elif x >= y: x %= y else: y %= x return x+y if __name__ == '__main__': x, y = map(int, input().split()) gcd = greatest_common_divisor(x, y) print(gcd)
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,080
s871954528
p02256
u605879293
1519028362
Python
Python3
py
Accepted
20
5604
188
def gcd(x, y): if x < y: x, y = [y, x] while y > 0: r = x % y x = y y = r return x x, y = [int(n) for n in input().split()] print(gcd(x, y))
p02256
<H1>Greatest Common Divisor</H1> <p> Write a program which finds the greatest common divisor of two natural numbers <i>a</i> and <i>b</i> </p> <H2>Input</H2> <p> <i>a</i> and <i>b</i> are given in a line sparated by a single space. </p> <H2>Output</H2> <p> Output the greatest common divisor of <i>a</i> and <i>b</...
54 20
2
32,081