QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#464844#5. 在线 O(1) 逆元ETO_leader60 5578ms3880kbC++23276b2024-07-06 15:21:472024-11-05 21:59:48

Judging History

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

  • [2024-11-05 21:59:48]
  • 管理员手动重测本题所有提交记录
  • 测评结果:60
  • 用时:5578ms
  • 内存:3880kb
  • [2024-07-06 15:21:48]
  • 评测
  • 测评结果:70
  • 用时:1112ms
  • 内存:3808kb
  • [2024-07-06 15:21:47]
  • 提交

answer

using ulint=unsigned long long;
static constexpr auto MOD=998244353;
void init(int p){}
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;
}
int inv(int x){return Inv(x);}

Details


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 12ms
memory: 3828kb

Test #2:

score: 20
Accepted
time: 1117ms
memory: 3880kb

Test #3:

score: 30
Accepted
time: 5578ms
memory: 3812kb

Test #4:

score: 0
Time Limit Exceeded

Test #5:

score: 0
Time Limit Exceeded