QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#288055 | #5. 在线 O(1) 逆元 | ScapeGoatTree | Compile Error | / | / | C++14 | 245b | 2023-12-21 17:30:35 | 2023-12-21 17:30:36 |
Judging History
This is a historical verdict posted at 2023-12-21 17:30:36.
- [2024-11-05 21:56:26]
- 管理员手动重测本题所有提交记录
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2023-12-21 17:30:36]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2023-12-21 17:30:35]
- Submitted
answer
#include "inv.h"
const int MOD=998244353;
const int MAXN=1e8+5;
int inv1[MOD];
void init(int p){
inv1[1]=1;
for(int i=2;i<=n;i++){
int k=p/i;
int r=p%i;
inv1[i]=1ll*(p-k)*inv1[r]%MOD;
}
}
int inv(int x){
return inv1[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:7:24: error: ‘n’ was not declared in this scope 7 | for(int i=2;i<=n;i++){ | ^