0
点赞
收藏
分享

微信扫一扫

Codeforces344_C(数学思维)

朱小落 2023-05-31 阅读 59


题目:http://codeforces.com/contest/344/problem/C

 

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>

using namespace std;
typedef long long LL;

LL a,b;

int main()
{
    cin>>a>>b;

    if(a>b) swap(a,b);
    LL ans = 0;
    while(b)
    {
        ans += a/b;
        a %= b;
        swap(a,b);
    }
    cout<<ans<<endl;
    return 0;
}

 

举报

相关推荐

0 条评论