QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#464857 | #5. 在线 O(1) 逆元 | ETO_leader | Compile Error | / | / | C++23 | 527b | 2024-07-06 15:28:19 | 2024-11-05 21:59:50 |
Judging History
你现在查看的是最新测评结果
- [2024-11-05 21:59:50]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-07-06 15:28:19]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-07-06 15:28:19]
- 提交
answer
#include<vector>
using std::vector;
using ulint=unsigned long long;
static constexpr auto MOD=998244353;
static constexpr auto mx=100000007;
vector<uint> q(mx);
constexpr auto Inv(ulint x){
auto res=1ull;auto b=MOD-2;
while(b){
if(b&1) (res*=x)%=MOD;
(x*=x)%=MOD;b>>=1;
}
return res;
}
void init(int p){
q[0]=1;
cir(i,1,mx) q[i]=(1ull*q[i-1]*i)%MOD;
auto iv=Inv(q[mx-1]);
for(auto i=mx-1;i;--i){
q[i]=(iv*q[i-1])%MOD;
iv=(1ull*iv*i)%MOD;
}
}
int inv(int x){return q[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:6:8: error: ‘uint’ was not declared in this scope; did you mean ‘ulint’? 6 | vector<uint> q(mx); | ^~~~ | ulint answer.code:6:12: error: template argument 1 is invalid 6 | vector<uint> q(mx); | ^ answer.code:6:12: error: template argument 2 is invalid answer.code: In function ‘void init(int)’: answer.code:16:10: error: invalid types ‘int[int]’ for array subscript 16 | q[0]=1; | ^ answer.code:17:13: error: ‘i’ was not declared in this scope 17 | cir(i,1,mx) q[i]=(1ull*q[i-1]*i)%MOD; | ^ answer.code:17:9: error: ‘cir’ was not declared in this scope 17 | cir(i,1,mx) q[i]=(1ull*q[i-1]*i)%MOD; | ^~~ answer.code:18:22: error: invalid types ‘int[int]’ for array subscript 18 | auto iv=Inv(q[mx-1]); | ^ answer.code:20:14: error: invalid types ‘int[int]’ for array subscript 20 | q[i]=(iv*q[i-1])%MOD; | ^ answer.code:20:23: error: invalid types ‘int[int]’ for array subscript 20 | q[i]=(iv*q[i-1])%MOD; | ^ answer.code: In function ‘int inv(int)’: answer.code:24:24: error: invalid types ‘int[int]’ for array subscript 24 | int inv(int x){return q[x];} | ^