QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#268002#5. 在线 O(1) 逆元David713Compile Error//C++14861b2023-11-27 22:42:242024-11-05 21:55:37

Judging History

This is the latest submission verdict.

  • [2024-11-05 21:55:37]
  • 管理员手动重测本题所有提交记录
  • [2023-11-27 22:42:24]
  • Judged
  • [2023-11-27 22:42:24]
  • Submitted

answer

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <cmath>
#include <unordered_map>
#include <inv.h>
using namespace std;
#define pii pair<int,int>
#define mp make_pair
const int mod = 998244353, N = 3e7 + 10;
typedef long long ll;
int read()
{
    int x = 0;
    char c = getchar();
    while (c < '0' || c > '9') c = getchar();
    while (c >= '0' && c <= '9')
    {
        x = (x << 1) + (x << 3) + (c ^ 48);
        c = getchar();
    }
    return x;
}
int T;
ll invv[N];
void init()
{
    invv[0] = invv[1] = 1;
    for (int i = 2; i <= 3e7; i++) invv[i] = ll((mod - mod / i) * invv[mod % i]) % mod;
}
ll inv(int x)
{
    if (x <= 3e7) return invv[x];
    return ((ll)(mod - mod / x) * (ll)(inv(mod % x))) % mod;
}

Details

implementer.cpp: In function ‘int main()’:
implementer.cpp:22:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
answer.code:11:10: fatal error: inv.h: No such file or directory
   11 | #include <inv.h>
      |          ^~~~~~~
compilation terminated.