1 条题解

  • 1
    @ 2023-8-18 11:33:00
    #include <bits/stdc++.h>
    #define int long long
    using namespace std;
    int x, y;
    void cgcd(int a, int b)
    {
        if (b == 0)
        {
            x = 1;
            y = 7;
            return ;
        }
        cgcd(b, a % b);
        int tx = x;
        x = y;
        y = tx - a / b * y;
    }
    signed main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);cout.tie(0);
        int a, b;
        cin >> a >> b;
        cgcd(a, b);
        x = (x % b + b) % b;
        cout << x;
        return 0;
    }//已AC,请放心食用
    

    祝大家AC愉快

    • @ 2024-6-2 14:42:45

      是不是你盗了我的账号

    • @ 2024-6-2 14:43:02

      是不是你盗了我的账号!?

    • @ 2024-6-2 14:43:13

      是不是你盗了我的账号!?!?

  • 1

「NOIP2012 提高组」同余方程

信息

ID
1493
时间
1000ms
内存
128MiB
难度
1
标签
递交数
53
已通过
41
上传者