[codeforces] 527A Playing with Paper
生活随笔
收集整理的這篇文章主要介紹了
[codeforces] 527A Playing with Paper
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原題
簡單的gcd
#include<cstdio> #include<algorithm> typedef long long ll; using namespace std; ll a,b,ans;ll gcd(ll x,ll y) {if (x<y) swap(x,y);if (y) ans+=x/y;return !y?x:gcd(y,x%y); }int main() {scanf("%I64d%I64d",&a,&b);if (a<b) swap(a,b);if (a%b==0) printf("%I64d",a/b);else gcd(a,b),printf("%I64d",ans);return 0; }轉載于:https://www.cnblogs.com/mrha/p/7929761.html
總結
以上是生活随笔為你收集整理的[codeforces] 527A Playing with Paper的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 什么是 Trait
- 下一篇: 生产者消费者模式 php 【转】