QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#188480 | #5. 在线 O(1) 逆元 | EnofTaiPeople | Compile Error | / | / | C++14 | 382b | 2023-09-25 21:20:26 | 2023-09-25 21:20:27 |
Judging History
This is a historical verdict posted at 2023-09-25 21:20:27.
- [2024-11-05 21:52:24]
- 管理员手动重测本题所有提交记录
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2023-09-25 21:20:27]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2023-09-25 21:20:26]
- Submitted
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);
}
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: 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; | ^~