QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#738513 | #5. 在线 O(1) 逆元 | dqw | 10 | 119ms | 42300kb | C++23 | 572b | 2024-11-12 19:15:10 | 2024-11-12 19:15:11 |
Judging History
answer
// __ __ _ _____ _ _ _____ ______ __
// \ \/ / / \|_ _| | | | | __ \ / __ \ \ /\ / /
// \ / / _ \ | | | | | | | | | | | | \ \ / \ / /
// / \ / ___ \| | | |_| | | |__| | |__| |\ V /\ V /
// /_/\_/_/ \_\_| \___/ |_____/ \___\_\ \_/ \_/ (TM)
#include <bits/stdc++.h>
#include "inv.h"
using namespace std;
#define ll long long
const int mod=998244353;
unordered_map<int,int>I;
void init(int p){return;}
int inv(int x)
{
if(x<=1)return x;
if(I.find(x)==I.end())I[x]=mod-1LL*mod/x*inv(mod%x)%mod;
return I[x];
}
Details
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 119ms
memory: 42300kb
Test #2:
score: 0
Time Limit Exceeded
Test #3:
score: 0
Time Limit Exceeded
Test #4:
score: 0
Time Limit Exceeded
Test #5:
score: 0
Time Limit Exceeded