QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#640853 | #5. 在线 O(1) 逆元 | masterhuang | Compile Error | / | / | C++20 | 314b | 2024-10-14 16:30:44 | 2024-10-14 16:30:45 |
Judging History
你现在查看的是测评时间为 2024-10-14 16:30:45 的历史记录
- [2024-11-05 22:05:41]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-10-14 16:30:45]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-10-14 16:30:44]
- 提交
answer
#include"inv.h"
const int N=1e7+5,mod=998244353;
int n=N-5,I[N];
inline void init(int p)
{
I[1]=1;
for(int i=2;i<=n;i++) I[i]=(mod-1ll*(mod/i)*I[mod%i])%mod;
}
inline int inv(int x)
{
if(x<=n) return I[x];
int q=mod/x,r=mod%x;
if(r<x/2) return mod-1ll*q*inv(r)%mod;
return 1ll*q*inv(x-r)%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); | ~~~~~^~~~~~~~~~ /usr/bin/ld: /tmp/ccuu0ewR.o: in function `main': implementer.cpp:(.text.startup+0x12b): undefined reference to `init(int)' /usr/bin/ld: implementer.cpp:(.text.startup+0x1d0): undefined reference to `inv(int)' collect2: error: ld returned 1 exit status