为什么这个还能RE了,我不是没开数组吗
查看原帖
为什么这个还能RE了,我不是没开数组吗
916946
Vera_suki楼主2023/8/13 11:03
#include <bits/stdc++.h>
#define int long long

using namespace std;

signed main(){
    int l,r;
    int ans=0;

    cin>>l>>r;
    if (l>r) swap(l,r);

    while (true){
        ans+=(r/l)*4*l;
        r%=l;
        swap(l,r);

        if (r==1) break;
    }

    cout<<ans;
    return 0;
}
2023/8/13 11:03
加载中...