QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#188480 | #5. 在线 O(1) 逆元 | EnofTaiPeople | Compile Error | / | / | C++14 | 382b | 2023-09-25 21:20:26 | 2023-09-25 21:20:27 |
Judging History
你现在查看的是测评时间为 2023-09-25 21:20:27 的历史记录
- [2024-11-05 21:52:24]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-09-25 21:20:27]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-09-25 21:20:26]
- 提交
answer
#include<bits/stdc++.h>
#include "inv.h"
using namespace std;
const int N=1e8+8,M=998244353;
int nv[N];
void init(int p){
int x;
nv[0]=nv[1]=1;
for(x=2;x<N;++x)
nv[x]=ll(M-M/x)*nv[M%x]%M;
}
int sol(int d){
if(d<N)return nv[d];
if(d<M-d){
return ll(M-M/d)*sol(M%d)%M;
}else{
d=M-d;
return ll(M/d)*sol(M%d)%M;
}
}
int inv(int x){
return sol(x);
}
詳細信息
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: In function ‘void init(int)’: answer.code:10:23: error: ‘ll’ was not declared in this scope 10 | nv[x]=ll(M-M/x)*nv[M%x]%M; | ^~ answer.code: In function ‘int sol(int)’: answer.code:15:24: error: ‘ll’ was not declared in this scope 15 | return ll(M-M/d)*sol(M%d)%M; | ^~ answer.code:18:24: error: ‘ll’ was not declared in this scope 18 | return ll(M/d)*sol(M%d)%M; | ^~