QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#489165 | #5. 在线 O(1) 逆元 | qwef_ | Compile Error | / | / | C++14 | 349b | 2024-07-24 18:44:42 | 2024-11-05 22:01:57 |
Judging History
你现在查看的是最新测评结果
- [2024-11-05 22:01:57]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-07-24 18:44:42]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-07-24 18:44:42]
- 提交
answer
#include "inv.h"
typedef long long ll;
const int N=1.27e8+114,p=998244353;
int a[N];
inline iny add(int& a,int b){a=(a+b>=p?a+b-p:a+b);}
void init(int _){
a[1]=1;
for(int i=2;i<N;++i) a[i]=(ll)(p-p/i)*a[p%i]%p;
}
int inv(int x){
for(int i=1,j=x;;++i,add(j,x))
if(j<N){
int k=a[j];
for(;--i;add(k,a[j]));
return k;
}
}
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:5:8: error: ‘iny’ does not name a type; did you mean ‘int’? 5 | inline iny add(int& a,int b){a=(a+b>=p?a+b-p:a+b);} | ^~~ | int answer.code: In function ‘int inv(int)’: answer.code:11:30: error: ‘add’ was not declared in this scope 11 | for(int i=1,j=x;;++i,add(j,x)) | ^~~