QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#268003#5. 在线 O(1) 逆元David713Compile Error//C++14383b2023-11-27 22:43:312024-11-05 21:55:38

Judging History

你现在查看的是最新测评结果

  • [2024-11-05 21:55:38]
  • 管理员手动重测本题所有提交记录
  • [2023-11-27 22:43:31]
  • 评测
  • [2023-11-27 22:43:31]
  • 提交

answer

#include <inv.h>
using namespace std;
const int mod = 998244353, N = 3e7 + 10;
typedef long long ll;
int T;
ll invv[N];
void init(int p)
{
    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;
}

详细

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:1:10: fatal error: inv.h: No such file or directory
    1 | #include <inv.h>
      |          ^~~~~~~
compilation terminated.