QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#4936#5. 在线 O(1) 逆元zombie46270 1118ms42648kbC++11308b2020-10-19 09:42:232021-12-19 05:38:15

Judging History

你现在查看的是测评时间为 2021-12-19 05:38:15 的历史记录

  • [2024-11-05 21:45:30]
  • 管理员手动重测本题所有提交记录
  • 测评结果:60
  • 用时:4217ms
  • 内存:42956kb
  • [2024-11-05 21:42:21]
  • 管理员手动重测本题所有提交记录
  • 测评结果:60
  • 用时:4099ms
  • 内存:42944kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2021-12-19 05:38:15]
  • 评测
  • 测评结果:70
  • 用时:1118ms
  • 内存:42648kb
  • [2020-10-19 09:42:23]
  • 提交

answer

#include <bits/stdc++.h>
#include "inv.h"
using namespace std;
const int mod=998244353;
const int N=10000010;
int invv[N];
int inv(int a){
	return a<N?invv[a]:1LL*(mod-mod/a)*inv(mod%a)%mod;
}
void init(int p){
	invv[0]=invv[1]=1;
	for (int i=2;i<N;++i) invv[i]=1LL*(mod-mod/i)*invv[mod%i]%mod;
}

Details

Test #1:

score: 30
Accepted
time: 104ms
memory: 42648kb

Test #2:

score: 40
Accepted
time: 1118ms
memory: 42588kb

Test #3:

score: 0
Time Limit Exceeded