QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#738455#5. 在线 O(1) 逆元dqw10 120ms42284kbC++23579b2024-11-12 19:06:332024-11-12 19:06:35

Judging History

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

  • [2024-11-12 19:06:35]
  • 评测
  • 测评结果:10
  • 用时:120ms
  • 内存:42284kb
  • [2024-11-12 19:06:33]
  • 提交

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())return I[x];
	return I[x]=mod-1LL*mod/x*inv(mod%x)%mod;
}

详细


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 120ms
memory: 42284kb

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