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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s884560711 | p02256 | u634490486 | 1546522284 | Python | Python3 | py | Accepted | 20 | 5608 | 173 | from sys import stdin
x, y = [int(x) for x in stdin.readline().rstrip().split()]
def gcd(a, b):
while b > 0:
a, b = b, a % b
return a
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,782 |
s829162000 | p02256 | u670433235 | 1551488134 | Python | Python3 | py | Accepted | 20 | 5600 | 151 | def gcd(x, y):
while x > 0:
x, y = y % x, x
return y
xy = list(map(int, input().split()))
x = xy[0]
y = xy[1]
y = gcd(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,783 |
s344079452 | p02256 | u332046103 | 1555678570 | Python | Python3 | py | Accepted | 20 | 5600 | 179 | def divide(a, b):
if a < b:
return divide(b, a)
if b == 0:
return a
return divide(b, a%b)
nums=list(map(int,input().split()))
ans = divide(nums[0], nums[1])
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
| 31,784 |
s524136655 | p02256 | u078616159 | 1555835481 | Python | Python3 | py | Accepted | 20 | 5600 | 135 |
def gcd(a,b):
if a<b: a,b=b,a
c=a%b
if c==0:
print(b)
else:
return gcd(b,c)
a,b = map(int, input().split())
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
| 31,785 |
s214866726 | p02256 | u805464373 | 1555925412 | Python | Python3 | py | Accepted | 20 | 5656 | 66 | 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
| 31,786 |
s771928632 | p02256 | u870370075 | 1556298572 | Python | Python3 | py | Accepted | 20 | 5600 | 147 | def gcd(x,y):
x,y=max(x,y),min(x,y)
if y==0:
return x
else:
return gcd(y, x%y)
a,b=map(int,input().split())
ans=gcd(a,b)
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
| 31,787 |
s120991320 | p02256 | u799595944 | 1556412550 | Python | Python3 | py | Accepted | 20 | 5600 | 250 | x,y = map(int,input().split(" "))
def gdp(x,y):
if x > y:
big = x
small = y
else:
big = y
small = x
if big%small == 0:
print(small)
return
else:
gdp(small,big%small)
gdp(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,788 |
s510581922 | p02256 | u548252256 | 1556463023 | Python | Python3 | py | Accepted | 20 | 5592 | 74 | 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
| 31,789 |
s235278044 | p02256 | u252054808 | 1556534199 | Python | Python3 | py | Accepted | 20 | 5600 | 161 | def gcd(x, y):
if x < y:
return gcd(y, x)
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,790 |
s047524614 | p02256 | u083560765 | 1556710541 | Python | Python3 | py | Accepted | 20 | 5600 | 156 | gcd=list(map(int,input().split()))
if gcd[0]<gcd[1]:
gcd[0],gcd[1]=gcd[1],gcd[0]
while gcd[1]>0:
r=gcd[0]%gcd[1]
gcd[0]=gcd[1]
gcd[1]=r
print(gcd[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,791 |
s255334274 | p02256 | u726481755 | 1558924521 | Python | Python3 | py | Accepted | 20 | 5664 | 189 | import math
def gcd(a,b):
if a<b: a,b=b,a
c=a%b
if c==0:
return b
else:
return gcd(b,c)
S=[ int(x) for x in input().split()]
print(gcd(S[0],S[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,792 |
s700970171 | p02256 | u482227082 | 1558936195 | Python | Python3 | py | Accepted | 20 | 5600 | 200 | def main():
x, y = map(int, input().split())
if y > x:
x, y = y, x
while y > 0:
r = x % y
x = y
y = r
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
| 31,793 |
s782571631 | p02256 | u852112234 | 1558944317 | Python | Python3 | py | Accepted | 20 | 5600 | 246 | x,y = map(int,input().split())
def swap(x,y):
temp = x
x = y
y = temp
return(x,y)
def gcd(x,y):
if x < y:
x,y= swap(x,y)
while(x != y and y != 0):
x = x%y
x,y = swap(x,y)
print(x)
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,794 |
s026994409 | p02256 | u764759179 | 1559115996 | Python | Python3 | py | Accepted | 20 | 5604 | 323 | #!/usr/bin/env python
# coding: utf-8
def gcd ( ax, ay):
x = ax
y = ay
while (True):
if x < y :
tmp = x
x = y
y = tmp
x=x %y
if x == 0:
return y
elif x == 1:
return 1
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,795 |
s771204369 | p02256 | u849117723 | 1559124383 | Python | Python3 | py | Accepted | 20 | 5600 | 161 | x,y=map(int,input().split())
def gg(a,b):
if a%b==0 and b%b==0:
return b
return gg(b,a%b)
if x>y:
print(gg(x,y))
else:
print(gg(y,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,796 |
s787843549 | p02256 | u662822413 | 1559223522 | Python | Python3 | py | Accepted | 20 | 5600 | 167 | def calc_gcd(a,b):
if a < b:
a,b=b,a
if b == 0:
return a
return calc_gcd(b,a%b)
x,y=map(int,input().split())
print("%d"%(calc_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,797 |
s095387017 | p02256 | u535719732 | 1559378814 | Python | Python3 | py | Accepted | 20 | 5600 | 178 | 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)
print(gcd(data[0],data[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,798 |
s194794037 | p02256 | u841945203 | 1559393096 | Python | Python3 | py | Accepted | 20 | 5596 | 260 | def GCD_calc(A,B):
if(A>=B):
big = A
small = B
else:
big = B
small = A
r=big%small
if r == 0:
return small
else:
return GCD_calc(small,r)
a,b = map(int,input().split())
print(GCD_calc(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,799 |
s629868927 | p02256 | u108666393 | 1559404706 | Python | Python3 | py | Accepted | 20 | 5596 | 109 | def gcd(a, b):
return a if b == 0 else gcd(b, a % b)
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
| 31,800 |
s069982764 | p02256 | u193025715 | 1408608798 | Python | Python3 | py | Accepted | 40 | 6724 | 175 | a, b = map(int, input().split())
if a > b: a, b = b, a
while True:
if b % a == 0:
print(a)
break
else:
b = b % a
if a > b: a, b = 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
| 31,801 |
s775629291 | p02256 | u244742296 | 1409493053 | Python | Python3 | py | Accepted | 40 | 6724 | 181 | def gcd(a, b):
while b != 0:
# gcd(a, b) == gcd(b, a%b)
rem = a % b
a = b
b = rem
return a
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
| 31,802 |
s782415032 | p02256 | u844945939 | 1414401520 | Python | Python3 | py | Accepted | 30 | 6724 | 82 | x, y = (int(s) for s in 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
| 31,803 |
s761876678 | p02256 | u379499530 | 1415026941 | Python | Python | py | Accepted | 20 | 4196 | 177 | def main():
nums = map(int, raw_input().split())
print gcd(nums[0], nums[1])
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, 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,804 |
s618404464 | p02256 | u507118101 | 1418214110 | Python | Python | py | Accepted | 20 | 4204 | 161 | a,b = map(int,raw_input().split(' '))
while(True):
if(a == b):
print a
break
if(a < b):
t = a
a = b
b = t
a,b = b,a%b
if(b == 0):
print a
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,805 |
s988517608 | p02256 | u672822075 | 1418912868 | Python | Python3 | py | Accepted | 40 | 6724 | 100 | a,b = map(int,input().split())
if a<b:
a,b = b,a
while 1:
if a%b==0:
break
a,b = b,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
| 31,806 |
s124900623 | p02256 | u481221703 | 1419511431 | Python | Python | py | Accepted | 20 | 4204 | 204 | a, b = map(int, raw_input().split())
def gcd(a,b):
c = a%b
if c==0:
return b
elif c == 1:
return c
else:
return gcd(b, c)
if a > b:
print gcd(a, b)
elif a < b:
print gcd(b, a)
else:
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
| 31,807 |
s835132847 | p02256 | u580607517 | 1420977996 | Python | Python | py | Accepted | 20 | 4196 | 125 | def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
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
| 31,808 |
s361762571 | p02256 | u567380442 | 1421239314 | Python | Python3 | py | Accepted | 30 | 6724 | 177 | a, b = map(int, input().split())
mini, big = (a, b) if a < b else (b, a)
while True:
rem = big % mini
if rem == 0:
break
mini, big = rem, mini
print(mini) | 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,809 |
s943097950 | p02256 | u813534019 | 1422237173 | Python | Python | py | Accepted | 20 | 4208 | 254 | l=[int(x) for x in raw_input().split(" ")]
def gcd(a,b):
if a > b:
mod = a % b
if mod==0: return b
return gcd(b, mod)
else:
mod = b % a
if mod==0: return a
return gcd(a, mod)
print gcd(l[0], l[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,810 |
s513333553 | p02256 | u284474275 | 1423833335 | Python | Python | py | Accepted | 20 | 4204 | 241 | import sys
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
if __name__ == '__main__':
ab = sys.stdin.readline()
a, b = ab.split()
a, b = int(a), int(b)
sys.stdout.write(str(gcd(a, b)) + '\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
| 31,811 |
s809848153 | p02256 | u879226672 | 1424416133 | Python | Python | py | Accepted | 20 | 4200 | 158 | def euclid(m,n):
while m%n>0:
m,n=n , m%n
else:
return n
x,y = map(int,raw_input().split())
if x < y:
x,y = y,x
print euclid(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,812 |
s871609076 | p02256 | u117053676 | 1425745580 | Python | Python3 | py | Accepted | 30 | 6724 | 128 | [x,y] = list(map(int, input().split()))
if x<y:
temp = x
x = y
y = temp
while y>0:
temp = x % y
x = y
y = temp
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,813 |
s194699810 | p02256 | u370429022 | 1426610941 | Python | Python3 | py | Accepted | 70 | 14756 | 120 | import fractions
if __name__ == '__main__':
x, y = [int(_) for _ in input().split()]
print(fractions.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,814 |
s452083123 | p02256 | u128811851 | 1429682074 | Python | Python3 | py | Accepted | 30 | 6724 | 242 | x, y = map(int, input().split())
def gcd(x, y):
if x % y == 0:
return y
elif x % y == 1:
return 1
else:
return gcd(y, x % y)
if x >= y:
n = gcd(x, y)
print(n)
else:
n = gcd(y, x)
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
| 31,815 |
s264715859 | p02256 | u002380486 | 1432030256 | Python | Python | py | Accepted | 20 | 4192 | 74 | x,y = map(int, raw_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
| 31,816 |
s772772831 | p02256 | u949338836 | 1432177187 | Python | Python3 | py | Accepted | 30 | 6724 | 143 | #coding:utf-8
x,y = list(map(int,input().split()))
if x < y:
x,y = y,x
r = x % y
while r != 0:
x = y
y = r
r = 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,817 |
s308125143 | p02256 | u949338836 | 1432177607 | Python | Python3 | py | Accepted | 30 | 6724 | 86 | #coding:utf-8
x,y = map(int,input().split())
while x%y != 0:
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,818 |
s103212649 | p02256 | u604774382 | 1432550872 | Python | Python | py | Accepted | 20 | 4204 | 201 | def gcd( x, y ):
if 1 < y < x:
return gcd( y, x%y )
else:
if y == 1:
return 1
return x
a, b = [ int( val ) for val in raw_input( ).split( " " ) ]
if a < b:
a, b = b, a
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
| 31,819 |
s297092907 | p02256 | u604774382 | 1432550904 | Python | Python3 | py | Accepted | 30 | 6724 | 197 | def gcd( x, y ):
if 1 < y < x:
return gcd( y, x%y )
else:
if y == 1:
return 1
return x
a, b = [ int( val ) for val in input( ).split( " " ) ]
if a < b:
a, b = b, a
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
| 31,820 |
s792584235 | p02256 | u604774382 | 1432551372 | Python | Python3 | py | Accepted | 40 | 6724 | 171 | def gcd( x, y ):
if 0 == y:
return x
else:
return gcd( y, x%y )
a, b = [ int( val ) for val in input( ).split( " " ) ]
if a < b:
a, b = b, a
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
| 31,821 |
s459565395 | p02256 | u442472098 | 1433410665 | Python | Python3 | py | Accepted | 30 | 6724 | 179 | #!/usr/bin/env python3
def gcd(x, y):
if y > x:
x, y = y, x
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,822 |
s399033033 | p02256 | u571345655 | 1435719815 | Python | Python | py | Accepted | 20 | 4200 | 228 | # coding: utf-8
def gcd(a, b):
if a < b:
a, b = b, a
while b:
a, b = b, a % b
return a
def main():
a, b = map(int, raw_input().split())
print gcd(a, b)
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
| 31,823 |
s151321329 | p02256 | u757519851 | 1435924076 | Python | Python3 | py | Accepted | 30 | 6724 | 246 | #!/usr/bin/env python
def GCD(x,y):
while y!=0:
tmp=y
y=x%y
x=tmp
return x
if __name__ == "__main__":
x,y=list(map(int,input().split()))
if x<y:
tmp=x
x=y
y=tmp
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,824 |
s754096681 | p02256 | u777299405 | 1436074411 | Python | Python3 | py | Accepted | 70 | 14756 | 75 | from fractions import gcd
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,825 |
s465300353 | p02256 | u777299405 | 1436074638 | Python | Python3 | py | Accepted | 30 | 6724 | 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
| 31,826 |
s530681131 | p02256 | u609407244 | 1436240013 | Python | Python3 | py | Accepted | 40 | 6724 | 95 | def gcd(a, b):
return gcd(b, a % b) if a % b else b
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,827 |
s691532668 | p02256 | u802705119 | 1437461188 | Python | Python3 | py | Accepted | 30 | 6724 | 268 | # GCD
def gcd(x, y):
if x % y > 0:
r = x % y
d = gcd(y, r)
else:
d = y
return d
x, y = [int(i) for i in input().split()]
if x < y:
buff = x
x = y
y = buff
elif x == y:
print(x)
exit()
d = gcd(x, y)
print(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
| 31,828 |
s373019919 | p02256 | u802705119 | 1437461218 | Python | Python3 | py | Accepted | 40 | 6724 | 268 | # GCD
def gcd(x, y):
if x % y > 0:
r = x % y
d = gcd(y, r)
else:
d = y
return d
x, y = [int(i) for i in input().split()]
if x < y:
buff = x
x = y
y = buff
elif x == y:
print(x)
exit()
d = gcd(x, y)
print(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
| 31,829 |
s071017078 | p02256 | u802705119 | 1437461259 | Python | Python3 | py | Accepted | 40 | 6724 | 268 | # GCD
def gcd(x, y):
if x % y > 0:
r = x % y
d = gcd(y, r)
else:
d = y
return d
x, y = [int(i) for i in input().split()]
if x < y:
buff = x
x = y
y = buff
elif x == y:
print(x)
exit()
d = gcd(x, y)
print(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
| 31,830 |
s737609638 | p02256 | u669284080 | 1438004757 | Python | Python | py | Accepted | 20 | 4200 | 176 | x, y = map(int, raw_input().split())
flag = True
while flag:
if y > x:
x, y = y, x
mod = x % y
x, y = y, mod
if mod == 0:
print x
quit() | 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,831 |
s436456051 | p02256 | u949338836 | 1439963393 | Python | Python3 | py | Accepted | 20 | 7744 | 141 | #coding:utf-8
#1_1_B
def gcd(x, y):
while x%y != 0:
x, y = y, x%y
return 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,832 |
s021800580 | p02256 | u722558010 | 1440669596 | Python | Python3 | py | Accepted | 50 | 7692 | 88 | a,b=map(int,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
| 31,833 |
s202413379 | p02256 | u938745275 | 1440954162 | Python | Python | py | Accepted | 10 | 6456 | 269 | def Euclidean(input_list):
# print input_list
x = input_list[1]
y = input_list[0]
r = x % y
if r != 0:
list = [r, y]
list.sort()
return Euclidean(list)
else:
return y
list = map(int, raw_input().split(" "))
list.sort()
print Euclidean(list) | 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,834 |
s345707626 | p02256 | u632424921 | 1442214364 | Python | Python | py | Accepted | 10 | 6448 | 241 | num_list = raw_input().split()
num_list = map(int, num_list)
def gcd(x, y):
if x < y:
x, y = y, x
while (y>0):
r = x % y
x = y
y = r
return x
x = num_list[0]
y = num_list[1]
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,835 |
s894083911 | p02256 | u253463900 | 1442214781 | Python | Python3 | py | Accepted | 20 | 7712 | 181 | s = input()
x,y = map(int,s.split())
while(x != y or x>1 or y > 1):
if(x < y):
tmp = x
x = y
y = tmp
if( y == 0):
break
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,836 |
s582583811 | p02256 | u019737947 | 1442215580 | Python | Python | py | Accepted | 30 | 6444 | 132 | ex = raw_input()
n_s, m_s = ex.split()
n = int(n_s)
m = int(m_s)
while n > 0:
temp = n
n = m % n
m = temp
print m
| 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,837 |
s176844323 | p02256 | u729824721 | 1442215952 | Python | Python | py | Accepted | 30 | 6452 | 239 | import sys
def div(x, y):
if x % y == 0:
print y
else:
div(y, x%y)
line = sys.stdin.readline()
x, y = line.split(" ")
x = int(x)
y = int(y)
if x < y:
x, y = y, x
if x == y:
print x
else:
div(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,838 |
s922013385 | p02256 | u885889402 | 1442216024 | Python | Python3 | py | Accepted | 20 | 7768 | 263 | def grecom(x,y):
if(x==0 or y==0):
return x+y
if(x==1 or y==1):
return 1
if(x==y):
return x
if(y>x):
return grecom(y%x,x)
else:
return grecom(x%y,y)
s = input()
a,b=map(int,s.split())
print(grecom(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,839 |
s120336210 | p02256 | u731976921 | 1442291727 | Python | Python | py | Accepted | 10 | 6328 | 227 | import sys
def gcd(x, y):
if y == 1:
return 1
elif y == 0:
return x
else:
return gcd(y, x % y)
line = sys.stdin.readline()
(a, b) = line.split()
a = int(a)
b = int(b)
if a > b:
b, a = a, b
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
| 31,840 |
s423943894 | p02256 | u520845247 | 1443291374 | Python | Python3 | py | Accepted | 30 | 7680 | 158 | a, b = map(int, input().split())
def gcd(a, b):
if a > b:
a, b = b, a
if b % a == 0:
return a
else:
return gcd(a, b % a)
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
| 31,841 |
s285136529 | p02256 | u240363515 | 1443922757 | Python | Python | py | Accepted | 10 | 6400 | 144 | inp = map(int, raw_input().split())
x = max(inp)
y = min(inp)
while True:
r = x % y
x = y
y = r
if y == 0:
break
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,842 |
s195586851 | p02256 | u224288634 | 1445565720 | Python | Python | py | Accepted | 10 | 6352 | 162 | def gcd(a,b):
if a%b==0:
return b
else :
return gcd(b,a%b)
def main():
a,b=map(int,raw_input().split())
print(gcd(a,b))
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
| 31,843 |
s918639732 | p02256 | u766163292 | 1446299207 | Python | Python3 | py | Accepted | 20 | 7740 | 295 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def mygcd(x, y):
if x == 0 or y == 0:
return max(x, y)
else:
(x1, y1) = (max(x, y), min(x, y))
return mygcd(y, x % y)
def main():
print(mygcd(*map(int, input().split())))
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
| 31,844 |
s023228572 | p02256 | u742797815 | 1446397376 | Python | Python3 | py | Accepted | 40 | 7724 | 144 | def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
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
| 31,845 |
s552107781 | p02256 | u960191521 | 1447020357 | Python | Python | py | Accepted | 10 | 6384 | 188 | #--coding:utf-8
def gcd(x, y):
if x < y:
gcd(y,x)
if x%y == 0:
return y
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
| 31,846 |
s428874800 | p02256 | u881590806 | 1447569798 | Python | Python | py | Accepted | 30 | 6388 | 209 | def gcd(a,b):
if b == 1:
return 1
elif b == 0:
return a
else:
return gcd(b,a%b)
a,b = map(int, raw_input().split(' '))
if a > b:
print gcd(a,b)
else:
print gcd(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
| 31,847 |
s116475366 | p02256 | u963402991 | 1447732684 | Python | Python3 | py | Accepted | 20 | 7636 | 151 | def gcd(a,b):
r = a % b
while r != 0:
a, b = b, r
r = a % b
return b
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
| 31,848 |
s304403106 | p02256 | u421942904 | 1449903994 | Python | Python | py | Accepted | 10 | 6448 | 414 | import sys
for i in sys.stdin:
lst = i.split(' ')
lst = map(int, lst)
lst.sort()
n = 1
maxn = 1
while n*n <= lst[0]:
if lst[0]%n == 0 and lst[1]%(lst[0]/n) == 0:
print lst[0]/n
break
elif lst[0]%n == 0 and ls... | 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,849 |
s220709483 | p02256 | u966364923 | 1450159484 | Python | Python3 | py | Accepted | 20 | 7732 | 144 | def gcd(a, b):
# ?????§??¬?´???°
while b > 0:
a, b = b, a % b
return a
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
| 31,850 |
s379289258 | p02256 | u797673668 | 1452333365 | Python | Python3 | py | Accepted | 20 | 7668 | 99 | x, y = map(int, input().split())
if x > y:
x, y = y, x
while x:
x, y = y % x, 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
| 31,851 |
s773747024 | p02256 | u321017034 | 1453387556 | Python | Python3 | py | Accepted | 20 | 7728 | 238 | 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__":
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,852 |
s852821682 | p02256 | u529386725 | 1453729367 | Python | Python3 | py | Accepted | 30 | 7684 | 146 | def gcd(a, b):
if b == 0:
return a
return gcd(b, a%b)
a, b = map(int, input().split())
if a < b:
a, b = b, a
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
| 31,853 |
s499965635 | p02256 | u731710433 | 1454867170 | Python | Python3 | py | Accepted | 20 | 7724 | 126 | x, y = [int(n) for n in input().split()]
while True:
tmp = x % y
if tmp == 0:
break
x, y = y, tmp
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,854 |
s772052255 | p02256 | u567281053 | 1456073287 | Python | Python | py | Accepted | 10 | 6308 | 214 | def euclideanAlg(n, m):
r = n % m
if r == 0:
return m
else:
return euclideanAlg(m, r)
if __name__ == "__main__":
A = map(int, raw_input().split())
print euclideanAlg(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
| 31,855 |
s818126447 | p02256 | u975539923 | 1457148558 | Python | Python | py | Accepted | 10 | 6444 | 208 | def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
s = map(int, raw_input().split())
if s[0] < s[1]:
print "%d" % gcd(s[1], s[0])
else:
print "%d" % gcd(s[1], s[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,856 |
s663288417 | p02256 | u148101999 | 1458109688 | Python | Python | py | Accepted | 10 | 6436 | 134 | x,y = map(int, raw_input().split())
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
| 31,857 |
s215152483 | p02256 | u994049982 | 1458604465 | Python | Python | py | Accepted | 10 | 6448 | 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]
print(a[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,858 |
s267768535 | p02256 | u650459696 | 1458912361 | Python | Python3 | py | Accepted | 20 | 7672 | 105 | a, b = map(int, input().split())
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, 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
| 31,859 |
s396910019 | p02256 | u512342660 | 1459062219 | Python | Python | py | Accepted | 10 | 6432 | 150 | def gcd(a,b):
if a == 0:
return b
else:
g = gcd(b%a,a)
return g
n1,n2 = map(int,raw_input().split())
print gcd(n1,n2) | 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,860 |
s227461419 | p02256 | u026681847 | 1459211297 | Python | Python3 | py | Accepted | 30 | 7744 | 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
| 31,861 |
s868069011 | p02256 | u779638168 | 1459438042 | Python | Python | py | Accepted | 10 | 6416 | 76 | A,B= map(int, raw_input().split())
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
| 31,862 |
s585769527 | p02256 | u130979865 | 1459668619 | Python | Python | py | Accepted | 30 | 6424 | 143 | # -*- coding: utf-8 -*-
def gcd(a, b):
while b:
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
| 31,863 |
s978443797 | p02256 | u572790226 | 1459900302 | Python | Python3 | py | Accepted | 20 | 7740 | 195 | def gcd(b, s):
mod = b % s
if mod != 0:
return gcd(s, mod)
else:
return s
x, y = map(int, input().split())
b = max(x, y)
s = min(x, y)
a = gcd(b, s)
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
| 31,864 |
s523735684 | p02256 | u894114233 | 1461077714 | Python | Python | py | Accepted | 10 | 6436 | 115 | def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
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
| 31,865 |
s448407411 | p02256 | u734765925 | 1462619151 | Python | Python3 | py | Accepted | 40 | 7704 | 105 | x,y = map(int, input().split())
def gcd(x,y):
return y, x%y
while y !=0:
x,y = gcd(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,866 |
s804259027 | p02256 | u778333573 | 1463091581 | Python | Python | py | Accepted | 10 | 6404 | 228 | import sys
def gcd(a, b):
while b != a :
if a > b:
a -= b
elif b > a:
b -= a
return a
x,y = map(int, raw_input().split())
a = gcd(x,y)
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
| 31,867 |
s329362456 | p02256 | u512342660 | 1463720367 | Python | Python | py | Accepted | 10 | 6376 | 429 | x,y = map(int,raw_input().split())
if x==y:
print x
else:
if y>x:
tmp = x
x = y
y = tmp
i=2
ans = 1
al = []
while i*i<=x:
if x % i ==0:
if y % i==0:
al.append(i)
x = x/i
y = y/i
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
| 31,868 |
s735816967 | p02256 | u512342660 | 1463720539 | Python | Python | py | Accepted | 10 | 6432 | 406 | x,y = map(int,raw_input().split())
if x==y:
print x
else:
if y>x:
tmp = x
x = y
y = tmp
i=2
ans = 1
al = []
while i*i<=x:
if x % i ==0:
if y % i==0:
al.append(i)
x = x/i
y = y/i
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
| 31,869 |
s623843337 | p02256 | u930806831 | 1464088552 | Python | Python3 | py | Accepted | 30 | 7708 | 214 | x, y = [int(a) for a in input().split()]
def divisor(x, y):
while x % y != 0:
amari = x % y
if amari == 0:
return y
x = y
y = amari
return y
print(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
| 31,870 |
s472795657 | p02256 | u003309334 | 1464125169 | Python | Python | py | Accepted | 10 | 6412 | 167 | def euclideanAlgorithm(x, y):
if y == 0: return x
return euclideanAlgorithm(y, x%y)
# MAIN
x, y = map(int, raw_input().split())
print euclideanAlgorithm(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,871 |
s067179633 | p02256 | u647766105 | 1464168603 | Python | Python3 | py | Accepted | 30 | 7716 | 195 | def gcd(x, y):
if x < y:
x, y = y, x
while y != 0:
x, y = y, x % y
return x
if __name__ == "__main__":
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
| 31,872 |
s096300555 | p02256 | u569960318 | 1464847564 | Python | Python3 | py | Accepted | 20 | 7716 | 154 | def gcd(x,y):
if x%y==0: return y
else : return gcd(y,x%y)
if __name__=='__main__':
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
| 31,873 |
s228000865 | p02256 | u858901574 | 1465051342 | Python | Python | py | Accepted | 10 | 6456 | 163 | import sys
import math
def gcd(x, y):
if y == 0:
return x
return gcd(y, x%y)
x, y = map(int, raw_input().split())
print gcd(min(x, y), max(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,874 |
s012630284 | p02256 | u181187284 | 1465787832 | Python | Python3 | py | Accepted | 40 | 7660 | 190 | #http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_B
x, y = map(int, input().split())
if y > x:
w = y
y = x
x = w
while y > 0:
amari = x % y
x = y
y = amari
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,875 |
s473660263 | p02256 | u203261375 | 1466244033 | Python | Python3 | py | Accepted | 30 | 7776 | 217 | import math
def gcd(a,b):
if a == 0:
return b
if b == 0:
return a
if a >= b:
return gcd(b, a%b)
else:
return gcd(a, b%a)
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
| 31,876 |
s571421111 | p02256 | u269653912 | 1466839761 | Python | Python | py | Accepted | 10 | 6412 | 106 | a,b =map(int,raw_input().split())
def gcd(a,b):
while b:
a,b=b,a%b
return a
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
| 31,877 |
s587788784 | p02256 | u496045719 | 1469366621 | Python | Python3 | py | Accepted | 40 | 7716 | 214 | def main():
a, b = list(map(int, input().split()))
if a < b:
a, b = b, a
while b > 1:
r = a % b
if r == 0:
break
a, b = b, r
print(b)
return 0
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
| 31,878 |
s387275865 | p02256 | u612243550 | 1469377485 | Python | Python3 | py | Accepted | 20 | 7708 | 194 | 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 = map(int, input().split(' '))
n = min(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
| 31,879 |
s765609615 | p02256 | u881590806 | 1469413649 | Python | Python | py | Accepted | 10 | 6400 | 168 | a,b = map(int,raw_input().split(' '))
def gcd(a,b):
if a < b:
a,b = b,a
if a%b==0:
return b
else:
return gcd(b,a%b)
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
| 31,880 |
s084263223 | p02256 | u626838615 | 1469957983 | Python | Python3 | py | Accepted | 30 | 7704 | 124 | x,y = map(int,input().split())
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
| 31,881 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.