Problem 2648 --Getting Started - Greatest Common Divisor

2648: Getting Started - Greatest Common Divisor

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $26$ 正确数量 $18$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Greatest Common Divisor

Write a program which finds the greatest common divisor of two natural numbers a and b

a and b are given in a line sparated by a single space.
Output the greatest common divisor of a and b.
54 20
2

1 ≤ a, b ≤ 10^9

You can use the following observation: 

For integers x and y, if x ≥ y, then gcd(x, y) = gcd(y, x%y)

推荐代码 查看2648 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] emmmmm 669479 2020-11-28 11:25:46
内存最少[$2016 $KB] 刘欢@计算机科学与技术161 424814 2019-05-12 09:52:28
第一AC Solitude 296650 2018-10-28 09:10:24
第一挑战 Solitude 296650 2018-10-28 09:10:24

赛题来源/所属竞赛 会津大学《挑战数据结构与算法》 挑战数据结构与算法

竞赛编号 竞赛名称 竞赛时间 访问比赛