悬关 AC求助
查看原帖
悬关 AC求助
921091
junwei楼主2024/11/7 21:30

1. 不要举报该帖

2. 该帖有意义

3. 该贴不为题解

4. 不允许弱智,没有任何辱骂的意思举报该帖, 并发布无意义内容

说了这么多其实没有求助,只是给一个不用手写快读的做法(啊对是求助AC了帮忙看一下为什么AC, 啊很明显这是虚假的内容

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const ll mod = 19260817;

ll meow_pow(ll a, ll b)
{
    ll res = 1;
    while (b)
    {
        if (b & 1) res = res * a % mod;

        a = a * a % mod;
        b >>= 1;
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    string A, B;
    cin >> A >> B;

    ll a = 0, b = 0;
    for (auto i : A)
    {
        ll k = i - '0';

        a = (a * 10 + k) % mod;
    }

    for (auto i : B)
    {
        ll k = i - '0';

        b = (b * 10 + k) % mod;
    }

    cout << a * meow_pow(b, mod - 2) % mod << '\n';


    return 0;
}
2024/11/7 21:30
加载中...