测试点数据自测无误,WA 0 分求调
查看原帖
测试点数据自测无误,WA 0 分求调
932039
lzy20091001楼主2024/3/29 23:04

https://www.luogu.com.cn/record/153309046

测试点 #1 数据

#include <iostream>

const int P = 19260817;

int read()
{
    int res = 0;
    char ch = getchar();

    while (isdigit(ch))
    {
        res = (res * 10 + ch - '0') % P;
        ch = getchar();
    }

    return res;
}

int qpow(int a, int b)
{
    if (b == 0)
        return 1;

    int res = 1;

    while (b != 0)
    {
        if (b & 1)
            res = 1ll * res * a % P;
        a = 1ll * a * a % P;
        b >>= 1;
    }

    return res;
}

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

    int a, b, b_inv;

    a = read();
    b = read();

    b_inv = qpow(b, P - 2);

    std::cout << 1ll * a * b_inv % P << "\n";

    return 0;
}

无论是本地还是洛谷在线 IDE 结果都是对的,但是每个点的测评记录都显示 wrong answer On line 1 column 1, read 0, expected 9.。求助。

2024/3/29 23:04
加载中...