QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#738513#5. 在线 O(1) 逆元dqw10 119ms42300kbC++23572b2024-11-12 19:15:102024-11-12 19:15:11

Judging History

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

  • [2024-11-12 19:15:11]
  • 评测
  • 测评结果:10
  • 用时:119ms
  • 内存:42300kb
  • [2024-11-12 19:15:10]
  • 提交

answer

//  __  __   _  _____ _   _   _____   ______          __
//  \ \/ /  / \|_   _| | | | |  __ \ / __ \ \   /\   / /
//   \  /  / _ \ | | | | | | | |  | | |  | \ \ /  \ / /
//   /  \ / ___ \| | | |_| | | |__| | |__| |\ V /\ V /
//  /_/\_/_/   \_\_|  \___/  |_____/ \___\_\ \_/  \_/ (TM)

#include <bits/stdc++.h>
#include "inv.h"
using namespace std;
#define ll long long
const int mod=998244353;
unordered_map<int,int>I;
void init(int p){return;}
int inv(int x)
{
	if(x<=1)return x;
	if(I.find(x)==I.end())I[x]=mod-1LL*mod/x*inv(mod%x)%mod;
	return I[x];
}

详细


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 119ms
memory: 42300kb

Test #2:

score: 0
Time Limit Exceeded

Test #3:

score: 0
Time Limit Exceeded

Test #4:

score: 0
Time Limit Exceeded

Test #5:

score: 0
Time Limit Exceeded