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
s017779242
p02256
u063179562
1390219785
Python
Python
py
Accepted
20
4200
162
l = map(int,raw_input().split()) l.sort() a,b = l max = 0 while True: tmp = a%b if tmp == 0: max = b break a = b b = tmp print max
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,182
s777970187
p02256
u904989881
1391585962
Python
Python
py
Accepted
20
4204
224
a, b = map(int,raw_input().split()) while True: if min(a, b) == 1: print 1 break elif 1 < b < a: a = a % b elif 1 < a < b: b = b % a else: print max(a, b) 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,183
s851434389
p02256
u633068244
1393742538
Python
Python
py
Accepted
20
4196
137
def gcd(m, n): if n == 0: return m else: return gcd(n, m%n) 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,184
s670205420
p02256
u387077254
1396508318
Python
Python
py
Accepted
20
4208
243
def gcd(a,b): c = a % b if c == 0: return b else: return gcd(b, c) if __name__ == "__main__": import sys a, b = [ int(e) for e in sys.stdin.readline().strip().split() ] print gcd(max(a,b), min(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,185
s413500814
p02256
u436634575
1400759424
Python
Python3
py
Accepted
30
6724
144
def gcd(x, y): if y == 0: return x else: return gcd(y, x % y) x, y = map(int, input().strip().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,186
s537466786
p02256
u242221792
1597905157
Python
Python3
py
Accepted
20
5600
266
number = list(map(int, input().split(" "))) if number[0] < number[1]: number[0], number[1] = number[1], number[0] remainder = 1 while remainder != 0: remainder = number[0]%number[1] number[0] = number[1] number[1] = remainder print(number[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,187
s975238850
p02256
u995254364
1597821875
Python
Python3
py
Accepted
20
5596
109
a,b = map(int,input().split()) k = max(a,b) l = min(a,b) while k % l != 0: x = k k = l l = x % l print(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
32,188
s765429377
p02256
u427834127
1597764025
Python
Python3
py
Accepted
20
5600
153
x,y=map(int,input().split()) while True: if x<y: x,y=y,x amari=x%y if amari==0: break else: x,y=y,amari 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,189
s429048771
p02256
u326077502
1597762674
Python
Python3
py
Accepted
20
5656
62
import math x,y=map(int,input().split()) print(math.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,190
s999724470
p02256
u869208015
1597761640
Python
Python3
py
Accepted
40
6960
80
import fractions m,n=map(int,input().split()) ans=fractions.gcd(m,n) 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,191
s842701413
p02256
u799076010
1597761165
Python
Python3
py
Accepted
40
6960
76
import fractions x,y=map(int,input().split()) A=fractions.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
32,192
s438403622
p02256
u413645175
1597761096
Python
Python3
py
Accepted
20
5600
144
def gcd(a,b): while b != 0: a,b = b,a % b return a x,y = map(int,input().split()) x,y = max(x,y),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
32,193
s649760435
p02256
u118506623
1597758831
Python
Python3
py
Accepted
20
5656
68
from math import gcd n,m = map(int,input().split()) print(gcd(n,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
32,194
s057188091
p02256
u782152619
1597753922
Python
Python3
py
Accepted
20
5656
62
import math x,y=map(int,input().split()) print(math.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,195
s086849239
p02256
u829520323
1597753723
Python
Python3
py
Accepted
20
5656
72
from math import gcd n, m = map(int, input().split()) print(gcd(n, 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
32,196
s122927913
p02256
u442912414
1597745123
Python
Python3
py
Accepted
20
5592
70
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,197
s187850138
p02256
u371026526
1597731126
Python
Python3
py
Accepted
20
5656
64
import math x,y = map(int,input().split()) print(math.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,198
s768163274
p02256
u322947441
1597725399
Python
Python3
py
Accepted
20
5656
71
import math; x,y = map(int,input().split()); print(math.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,199
s610326120
p02256
u799016206
1597683869
Python
Python3
py
Accepted
20
5652
62
import math x,y=map(int,input().split()) print(math.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,200
s624517385
p02256
u100874602
1597675769
Python
Python3
py
Accepted
20
5600
95
x,y=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,201
s094023223
p02256
u976648183
1597656221
Python
Python3
py
Accepted
20
5656
65
import math x,y=map(int,(input().split())) print(math.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,202
s580339668
p02256
u009468286
1597654746
Python
Python3
py
Accepted
20
5656
68
import math x, y = map(int, input().split()) print(math.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,203
s499013926
p02256
u257570657
1597645664
Python
Python3
py
Accepted
30
5600
92
x,y=map(int,input().split()) if y>x: x,y=y,x while y!=0: x=x%y x,y=y,x 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,204
s335364563
p02256
u931484744
1597630291
Python
Python3
py
Accepted
20
5604
196
# coding: utf-8 # Your code here! def gcd(x, y): if x % y == 0: return y else: return gcd(y, x % y) x, y = map(int, input().split()) if x < y: x, y = y, x 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,205
s690686013
p02256
u593595530
1597606646
Python
Python3
py
Accepted
20
5652
72
from math import gcd n, m = map(int, input().split()) print(gcd(n, 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
32,206
s995426652
p02256
u497248335
1597596244
Python
Python3
py
Accepted
20
5600
87
x,y=map(int,input().split()) if x<y: x,y=y,x 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
32,207
s486672316
p02256
u189528630
1597574113
Python
Python3
py
Accepted
40
6956
74
import fractions x,y = map(int,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
32,208
s945727037
p02256
u571995157
1597489482
Python
Python3
py
Accepted
20
5600
187
x, y = map(int, (input().split())) if x >= y: large, small = x, y else: large, small = y, x while small > 0: r = large % small large = small small = r print(large)
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,209
s649623104
p02256
u397004753
1597477535
Python
Python3
py
Accepted
20
5600
141
def gcd(x,y): while y > 0: r = x%y x = y y = r return x X,Y = map(int,input().split()) x,y=max(X,Y),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
32,210
s921618249
p02256
u799752967
1597468460
Python
Python3
py
Accepted
20
5656
74
from math 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
32,211
s817312817
p02256
u288578617
1597420154
Python
Python3
py
Accepted
20
5656
64
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,212
s955035861
p02256
u215733299
1597395390
Python
Python3
py
Accepted
20
5596
122
X, Y = map(int, input().split()) x = min(X, Y) y = max(X, Y) while x > 0: r = y % x y = x x = r 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,213
s519495955
p02256
u781215638
1597371396
Python
Python3
py
Accepted
20
5656
65
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,214
s835505759
p02256
u574841425
1597321966
Python
Python3
py
Accepted
30
6380
275
from enum import Enum import sys import math BIG_NUM = 2000000000 MOD = 1000000007 EPS = 0.000000001 def calc_gcd(a,b): if a < b: a,b = b,a if b == 0: return a return calc_gcd(b,a%b) A,B = map(int,input().split()) print("%d"%(calc_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,215
s200732458
p02256
u823513038
1597302048
Python
Python3
py
Accepted
20
5588
81
X, Y = map(int, input().split()) while Y != 0: T = X X = Y Y = T % 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,216
s396153781
p02256
u171326376
1597294782
Python
Python3
py
Accepted
50
6956
73
from fractions 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,217
s490154622
p02256
u261371912
1597221303
Python
Python3
py
Accepted
20
5596
154
x,y = map(int,input().split()) if x < y: prev_x = x prev_y = y x = prev_y y = prev_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,218
s515213952
p02256
u333677472
1597136587
Python
Python3
py
Accepted
20
5604
265
x,y = (int(x) for x in input().split()) q = x // y r = x % y a = y b = r if (r == 0): print(x) exit() else: while (r != 0): q = a // b r = a % b if (r == 0): print(b) break a = b b = r
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,219
s153361567
p02256
u129428695
1597055262
Python
Python3
py
Accepted
20
5600
107
x, y = 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,220
s795037824
p02256
u333382219
1597040737
Python
Python3
py
Accepted
20
5600
102
x, y = map(int, input().split()) if x > y: x, y = y, x 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
32,221
s558774621
p02256
u775765468
1596932262
Python
Python3
py
Accepted
40
5600
189
def gcd(x,y): if x < y: x,y = y,x while y > 0: r = x % y x = y y = r gcd(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
32,222
s019501079
p02256
u900012957
1596910101
Python
Python3
py
Accepted
20
5652
64
import math x,y = map(int,input().split()) print(math.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,223
s709970559
p02256
u123158238
1596875353
Python
Python3
py
Accepted
20
5596
117
x, y = map(int, input().split()) while True: if y == 0: break else: 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,224
s463092565
p02256
u996694149
1596733713
Python
Python3
py
Accepted
20
5664
73
import math x,y = (int(x) for x in input().split()) print(math.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,225
s100451209
p02256
u896809383
1596648056
Python
Python3
py
Accepted
20
5652
72
from math import gcd n, m = map(int, input().split()) print(gcd(n, 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
32,226
s825810096
p02256
u919773430
1596632316
Python
Python3
py
Accepted
20
5656
68
a , b = map(int, input().split()) import math 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,227
s066261149
p02256
u413704014
1596621140
Python
Python3
py
Accepted
20
5668
79
# 76 import math x,y = (int(x) for x in input().split()) print(math.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,228
s560728788
p02256
u089349639
1596526770
Python
Python3
py
Accepted
20
5596
383
def show(A, n): for i in range(n): if i != n-1: print(A[i], end=' ') else: print(A[i]) def gcd(a, b): if a < b: a, b = b, a while a % b != 0: c = a % b a = b b = c return b def main(): a, b = 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,229
s510732157
p02256
u392970366
1596515920
Python
Python3
py
Accepted
20
5588
67
x, y = map(int, 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
32,230
s891748506
p02256
u350481745
1596503844
Python
Python3
py
Accepted
20
5656
62
import math x,y=map(int,input().split()) print(math.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,231
s058540075
p02256
u309196579
1596469365
Python
Python3
py
Accepted
20
5588
67
x, y = map(int, 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
32,232
s574006421
p02256
u709176169
1596467375
Python
Python3
py
Accepted
20
5656
63
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,233
s469723944
p02256
u444626963
1596447837
Python
Python3
py
Accepted
20
5656
67
import math x,y = map(int,input().split()) print(math.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,234
s133716548
p02256
u635020217
1596433842
Python
Python3
py
Accepted
30
5660
100
# coding: utf-8 # Your code here! 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,235
s668235684
p02256
u874049078
1596431043
Python
Python3
py
Accepted
20
5656
89
#77 最大公約数 import math x, y = map(int,input().split()) print(math.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,236
s325717366
p02256
u677563181
1596418754
Python
Python3
py
Accepted
40
6956
74
from fractions import gcd print(gcd(*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,237
s175847816
p02256
u053015104
1596388806
Python
Python3
py
Accepted
20
5600
116
x, y = 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,238
s913102841
p02256
u940983140
1596388471
Python
Python3
py
Accepted
50
6956
71
a,b=map(int,input().split()) from fractions import gcd 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,239
s420682119
p02256
u512192552
1596374156
Python
Python3
py
Accepted
20
5604
120
# coding: utf-8 # Your code here! x,y=map(int,input().split()) x,y=sorted([x,y]) 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
32,240
s480148430
p02256
u053513395
1596352427
Python
Python3
py
Accepted
20
5608
331
#-*-coding:utf-8-*- import sys input=sys.stdin.readline def gcd(x,y): r = x % y if r == 0: return y else: while r != 0: tmp = y % r y = r r = tmp return y def main(): a,b=map(int,input().split()) print(gcd(a,b)) if __name__=="__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,241
s094808712
p02256
u140569607
1596289338
Python
Python3
py
Accepted
20
5600
175
def gcd(x,y): if x < y: x, y = y, x if y == 0: return x return gcd(y, x % y) x,y = map(int,input().split()) ans = 0 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,242
s580185936
p02256
u251716708
1596251980
Python
Python3
py
Accepted
40
6960
80
import fractions m,n=map(int,input().split()) ans=fractions.gcd(m,n) 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,243
s985285571
p02256
u733357255
1596129700
Python
Python3
py
Accepted
20
5600
191
def gcd(x,y): if y>x: x,y = y,x if y==0: return x elif x==y: return x 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,244
s306998113
p02256
u741657101
1595918358
Python
Python3
py
Accepted
20
5596
116
def gcd(a,b): if a == 0: return b return gcd(b%a,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
32,245
s397054188
p02256
u633358233
1595904531
Python
Python3
py
Accepted
20
5600
165
N, M = map(int, input().split()) while True : if N < M : N, M = M, N a = N % M if a == 0 : break else : N, M = M, a 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
32,246
s796920654
p02256
u221550784
1595896736
Python
Python3
py
Accepted
20
5600
141
x,y=map(int,input().split()) if y>x: x,y=y,x while True: z=x%y if z==0: break else: x=y y=z 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,247
s687372325
p02256
u826807985
1595859870
Python
Python3
py
Accepted
20
5600
98
n,m = map(int,input().split()) if n < m: n,m = m,n while n % m !=0: n,m = m,n%m 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
32,248
s143051304
p02256
u037263780
1595847970
Python
Python3
py
Accepted
20
5656
62
import math x,y=map(int,input().split()) print(math.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,249
s584070642
p02256
u904289400
1595831191
Python
Python3
py
Accepted
20
5656
63
import math x,y=map(int,input().split()) print(math.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,250
s442185576
p02256
u272062354
1595829737
Python
Python3
py
Accepted
40
6956
77
import fractions a, b = map(int, input().split()) print(fractions.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,251
s649868337
p02256
u586171604
1595825447
Python
Python3
py
Accepted
20
5652
72
from math import gcd n, m = map(int, input().split()) print(gcd(n, 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
32,252
s748383934
p02256
u711365732
1595667908
Python
Python3
py
Accepted
20
5596
153
x,y = map(int, input().split()) while True: if x<y: z = y y = x x = z k = x%y if k==0: break x = y y = k 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,253
s933541600
p02256
u555228137
1595631719
Python
Python3
py
Accepted
40
6960
73
import fractions as fra x,y=map(int,input().split()) print(fra.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,254
s741009330
p02256
u822891605
1595583539
Python
Python3
py
Accepted
20
5668
83
import math v = [int(d) for d in input().split(" ")] print(math.gcd(v[0], v[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,255
s467957253
p02256
u926092389
1595483211
Python
Python3
py
Accepted
20
5656
62
import math x,y=map(int,input().split()) print(math.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,256
s357882387
p02256
u630948380
1595430757
Python
Python3
py
Accepted
40
6956
77
import fractions a, b = map(int, input().split()) print(fractions.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,257
s913185589
p02256
u729823147
1595395790
Python
Python3
py
Accepted
20
5600
112
a, b = map(int, input().split()) while b > 0: if a < b: a, b = b, a 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,258
s130209783
p02256
u410978079
1595388491
Python
Python3
py
Accepted
20
5612
198
# coding: utf-8 # Your code here! def calc(a, b): if a < b: a,b = b,a if b == 0: return a return calc(b, a%b) A, B = map(int, input().split()) print(f'{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
32,259
s259109119
p02256
u474889652
1595380185
Python
Python3
py
Accepted
20
5652
62
a,b=map(int,input().split()) import math 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,260
s102659939
p02256
u470391435
1595320942
Python
Python3
py
Accepted
20
5656
69
from math 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
32,261
s987566218
p02256
u687088962
1595287956
Python
Python3
py
Accepted
20
5600
140
a, b = map(int, input().split(' ')) if a < b : a, b = b, a while True: if b == 0: print(a) break a, b = b, 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,262
s644724736
p02256
u838993229
1595223740
Python
Python3
py
Accepted
20
5596
226
def gozyo(x,y): while True: if y == 0: return x x = x % y z = x x = y y = z a,b = map(int,input().split()) if a < b: c = a a = b b = c print(gozyo(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,263
s127945606
p02256
u511292942
1595207276
Python
Python3
py
Accepted
20
5600
106
a,b = map(int,input().split()) if a < b: a,b = b,a while b != 0: c = a % b a,b = b,c 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,264
s938691897
p02256
u795882061
1595080757
Python
Python3
py
Accepted
20
5596
107
x, y = map(int,input().split()) if x < y: x, y = y, x 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
32,265
s492547972
p02256
u802474686
1595067043
Python
Python3
py
Accepted
20
5596
106
x,y=map(int,input().split()) if y>x: x,y=y,x while x%y!=0: m=x%y x,y=max(y,m),min(y,m) 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,266
s009881536
p02256
u829817944
1595033252
Python
Python3
py
Accepted
20
5656
68
import math x, y = map(int, input().split()) print(math.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,267
s405526046
p02256
u141099640
1594906761
Python
Python3
py
Accepted
20
5596
123
m, n = map(int, input().split()) x = max(m, n) y = min(m, n) while y > 0: temp = y y = x % y x = 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
32,268
s069929359
p02256
u596129030
1594703687
Python
Python3
py
Accepted
20
5600
95
x,y=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,269
s963377075
p02256
u726954442
1594692050
Python
Python3
py
Accepted
20
5604
267
def gcd(x,y): if x >= y: r = x % y if r == 0: return y return gcd(y,r) else: r = y % x if r == 0: return x return gcd(x,r) a = list(map(int,input().split())) print(str(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,270
s579463377
p02256
u972252150
1594680472
Python
Python3
py
Accepted
20
5600
176
def gcm(x, y): if x < y: x, y = y, x if x % y == 0: return y else: return gcm(y, x % y) x, y = map(int, input().split()) print(gcm(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,271
s471982063
p02256
u389029213
1594655265
Python
Python3
py
Accepted
20
5600
146
x, y = 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,272
s314574825
p02256
u173393391
1594623158
Python
Python3
py
Accepted
30
5656
63
import math x,y=map(int,input().split()) print(math.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,273
s511782256
p02256
u988962397
1594617353
Python
Python3
py
Accepted
20
5600
96
x,y=map(int, input().split()) if x<y: x,y=y,x while y!=0: x=x%y x,y=y,x 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,274
s265200167
p02256
u695386605
1594616988
Python
Python3
py
Accepted
20
5600
106
x, y = map(int,input().split()) if x > y: x, y = y, x 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
32,275
s573116251
p02256
u783987868
1594486188
Python
Python3
py
Accepted
20
5596
123
x, y = map(int,input().split()) if x<y: a = x x = y y = a 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,276
s366275530
p02256
u170149447
1594451073
Python
Python3
py
Accepted
20
5656
65
import math x,y = map(int,input().split()) print(math.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,277
s812045326
p02256
u040188532
1594289126
Python
Python3
py
Accepted
20
5600
107
a, b = map(int, input().split()) if b > a: 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
32,278
s494174062
p02256
u842789771
1594278782
Python
Python3
py
Accepted
20
5656
72
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,279
s365295145
p02256
u878424017
1594262818
Python
Python3
py
Accepted
40
6956
73
from fractions 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,280
s199251167
p02256
u880802684
1594113300
Python
Python3
py
Accepted
20
5608
303
import sys input = sys.stdin.readline def gcd(x: int, y: int) -> int: if x < y: x, y = y, x while y > 0: r = x % y x, y = y, r return x def main(): X, Y = [int(i) for i in input().strip().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,281