QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#822651#5. 在线 O(1) 逆元BehruzbekXCompile Error//C++20237b2024-12-20 15:16:082024-12-20 15:16:09

Judging History

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

  • [2024-12-20 15:16:09]
  • 评测
  • [2024-12-20 15:16:08]
  • 提交

answer

#include <bits/stdc++.h>

#define mod 998244353

using ll = long long;
void init(int p) {
}
ll bpow (ll a, ll b) {
ll r = 1;
for(;b;b>>=1, a = (a*a)%mod)if(b&1)r=(r*a)%mod;
return r;
}
ll inv(ll n){return bpow(n, mod - 2);}

详细

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);
      |         ~~~~~^~~~~~~~~~
/usr/bin/ld: /tmp/cczBpnR3.o: in function `main':
implementer.cpp:(.text.startup+0x1d0): undefined reference to `inv(int)'
collect2: error: ld returned 1 exit status