QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#23826#5. 在线 O(1) 逆元feecle641870 1586ms81836kbC++20322b2022-03-19 16:35:112022-04-30 04:19:44

Judging History

This is a historical verdict posted at 2022-04-30 04:19:44.

  • [2024-11-05 21:46:33]
  • 管理员手动重测本题所有提交记录
  • Verdict: 80
  • Time: 5955ms
  • Memory: 82004kb
  • [2024-11-05 21:43:05]
  • 管理员手动重测本题所有提交记录
  • Verdict: 80
  • Time: 5853ms
  • Memory: 82012kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-04-30 04:19:44]
  • Judged
  • Verdict: 70
  • Time: 1586ms
  • Memory: 81836kb
  • [2022-03-19 16:35:11]
  • Submitted

answer

#include<bits/stdc++.h>
#include"inv.h"
using namespace std;
typedef long long ll;
const int mod=998244353;
int ny[20000005];
int inv(int x){
	if(x<=20000000)return ny[x];
	return 1ll*inv(mod%x)*(mod-mod/x)%mod;
}
void init(int p){
	ny[1]=1;
	for(int i=2;i<=20000000;i++)ny[i]=1ll*ny[mod%i]*(mod-mod/i)%mod;
}

詳細信息

Test #1:

score: 30
Accepted
time: 385ms
memory: 81792kb

Test #2:

score: 40
Accepted
time: 1586ms
memory: 81836kb

Test #3:

score: 0
Time Limit Exceeded