为什么?

P11362 [NOIP2024] 遗失的赋值

Happy_Doggie @ 2024-12-01 09:47:51

#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int c[N], d[N];
long long qpow(long long a, long long b)
{
    long long ans = 1;
    while (b)
    {
        if (b & 1)
            ans = (ans * a) % 1000000007;
        b >>= 1;
        a = (a * a) % 100000007;
    }
    return ans;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        long long n, m, v;
        cin >> n >> m >> v;
        for (int i = 1; i <= m; i++)
            cin >> c[i] >> d[i];
        if (m == 1)
            cout << qpow(v * v, n - 1) << endl;
        else
            printf("0\n");
    }
    return 0;
}

为什么0分呢?


by dtw35l @ 2024-12-01 10:16:19

错了两处

一个是100000007你少了个0

还有就是你v*v再直接快速幂爆long long 了


|