QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#102596#5. 在线 O(1) 逆元liuzhenhao0970 2443ms394144kbC++20343b2023-05-03 14:55:322023-05-03 14:55:35

Judging History

你现在查看的是测评时间为 2023-05-03 14:55:35 的历史记录

  • [2024-11-05 21:49:22]
  • 管理员手动重测本题所有提交记录
  • 测评结果:80
  • 用时:5156ms
  • 内存:394504kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-03 14:55:35]
  • 评测
  • 测评结果:70
  • 用时:2443ms
  • 内存:394144kb
  • [2023-05-03 14:55:32]
  • 提交

answer

#include<bits/stdc++.h>
#include "inv.h"
using namespace std;
const int MOD = 998244353;
int iv[100000010];
int inv(int x){
	if(x <= 100000000) return iv[x];
	return 1LL * inv(MOD % x) * (MOD - MOD / x) % MOD;
}
void init(int p){
	iv[1] = 1;
	for(int i = 2; i <= 100000000; i++) iv[i] = 1LL * (MOD - MOD / i) * iv[MOD % i] % MOD;
}

详细

Test #1:

score: 30
Accepted
time: 1250ms
memory: 394144kb

Test #2:

score: 40
Accepted
time: 2443ms
memory: 394132kb

Test #3:

score: 0
Time Limit Exceeded