QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#713811 | #5. 在线 O(1) 逆元 | Mango2011 | Compile Error | / | / | C++20 | 356b | 2024-11-05 20:36:02 | 2024-11-05 22:08:14 |
Judging History
你现在查看的是最新测评结果
- [2024-11-05 22:08:14]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-11-05 20:36:02]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-11-05 20:36:02]
- 提交
answer
#include<bits/stdc++.h>
#include "inv.h"
#define ll long long
const ll mod=998244353;
int qp(ll x,int y){
ll res=1;
while(y){
if(y&1){
res=res*x%mod;
}
x=x*x%mod;
y>>=1;
}
return res;
}
int inv[100005];
void init(int P){
for(int i=0;i<100000;i++){
inv[i]=qp(i,mod-2);
}
}
int inv(int x)
{
return inv[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:16:15: error: ‘int inv [100005]’ redeclared as different kind of entity 16 | int inv[100005]; | ^ In file included from answer.code:2: inv.h:2:5: note: previous declaration ‘int inv(int)’ 2 | int inv(int n); | ^~~ answer.code: In function ‘void init(int)’: answer.code:19:17: warning: pointer to a function used in arithmetic [-Wpointer-arith] 19 | inv[i]=qp(i,mod-2); | ^ answer.code:19:18: error: assignment of read-only location ‘*(inv + ((sizetype)i))’ 19 | inv[i]=qp(i,mod-2); | ~~~~~~^~~~~~~~~~~~ answer.code: In function ‘int inv(int)’: answer.code:24:21: warning: pointer to a function used in arithmetic [-Wpointer-arith] 24 | return inv[x]; | ^ answer.code:24:21: error: invalid conversion from ‘int (*)(int)’ to ‘int’ [-fpermissive] 24 | return inv[x]; | ^ | | | int (*)(int)