QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#489103 | #5. 在线 O(1) 逆元 | _FJqwq | 70 | 2058ms | 3880kb | C++14 | 300b | 2024-07-24 18:00:19 | 2024-07-24 18:00:19 |
Judging History
answer
#include<bits/stdc++.h>
#include"inv.h"
using namespace std;
#define ll long long
const int N=2005,mod=998244353;
ll power(ll x,ll y){
if(!y) return 1ll;
ll z=power(x,y>>1ll);
z=z*z%mod;
if(y&1ll) return z*x%mod;
return z;
}
void init(int p){}
int inv(int x){return power(x,mod-2);}
Details
Pretests
Final Tests
Test #1:
score: 30
Accepted
time: 21ms
memory: 3752kb
Test #2:
score: 40
Accepted
time: 2058ms
memory: 3880kb
Test #3:
score: 0
Time Limit Exceeded