QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#179894 | #5. 在线 O(1) 逆元 | Summer_Sheep | Compile Error | / | / | C++14 | 351b | 2023-09-15 12:50:58 | 2024-11-05 21:52:22 |
Judging History
你现在查看的是最新测评结果
- [2024-11-05 21:52:22]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-09-15 12:50:59]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-09-15 12:50:58]
- 提交
answer
#include<bits/stdc++.h>
#include "inv.h"
#define int long long
using namespace std;
const int mod=998244353;
int qpow(int a,int b)
{
int res=1;
while(b)
{
if(b&1)
{
res*=a;
res%=mod;
b--;
}
a*=a;
a%=mod;
b/=2;
}
return res;
}
void init(int p)
{
mod=p;
}
int inv(int x)
{
return qpow(x,mod-2);
}
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(long long int)’: answer.code:25:12: error: assignment of read-only variable ‘mod’ 25 | mod=p; | ~~~^~