QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#850051#5. 在线 O(1) 逆元mnbvcxz12330 1215ms3896kbC++23345b2025-01-09 20:00:082025-01-09 20:00:08

Judging History

你现在查看的是最新测评结果

  • [2025-01-09 20:00:08]
  • 评测
  • 测评结果:30
  • 用时:1215ms
  • 内存:3896kb
  • [2025-01-09 20:00:08]
  • 提交

answer

#include"inv.h"
#include<bits/stdc++.h>
using namespace std;
using ll=long long;

constexpr int mod=998244353;

ll exp(ll a, ll w){
    ll ret=1;
    a%=mod;
    while(w){
        if(w&1)ret=ret*a%mod;
        a=a*a%mod;
        w>>=1;
    }
    return ret;
}

void init(int p){}

int inv(int x){
    return exp(x,mod-2);
}

詳細信息


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 13ms
memory: 3896kb

Test #2:

score: 20
Accepted
time: 1215ms
memory: 3688kb

Test #3:

score: 0
Time Limit Exceeded

Test #4:

score: 0
Time Limit Exceeded

Test #5:

score: 0
Time Limit Exceeded