朱小落

关注

Codeforces344_C(数学思维)

朱小落

关注

阅读 59

2023-05-31


题目: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;
}

 

相关推荐

q松_松q

codeforces-257【C思维,数学】

q松_松q 124 0 0

五殳师兄

CodeForces 1200C Round Corridor(数学+思维)

五殳师兄 138 0 0

Silence潇湘夜雨

【CodeForces - 124C】Prime Permutation(数学,思维,小结论)

Silence潇湘夜雨 65 0 0

冶炼厂小练

【CodeForces - 1084C】The Fair Nut and String(思维,组合数学)

冶炼厂小练 157 0 0

书坊尚

【CodeForces - 347C 】Alice and Bob (思维,数学,等差数列)

书坊尚 41 0 0

有点d伤

【CodeForces - 501C】Misha and Forest (思维构造,树,数学异或)

有点d伤 34 0 0

Fifi的天马行空

CodeForces - 1027C Minimum Value Rectangle 数学思维(没出来)

Fifi的天马行空 89 0 0

夕颜合欢落

codeforces - 1315C - 思维题

夕颜合欢落 61 0 0

岁月不饶人老不正经

CodeForces - 233C Cycles(思维)

岁月不饶人老不正经 24 0 0

柠檬的那个酸_2333

codeforces1627C Not Assigning(思维)

柠檬的那个酸_2333 82 0 0

精彩评论(0)

0 0 举报