QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#624838#5. 在线 O(1) 逆元BlackPanda0 0ms0kbC++14230b2024-10-09 16:42:212024-11-05 22:04:46

Judging History

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

  • [2024-11-05 22:04:46]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-10-09 16:42:21]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-10-09 16:42:21]
  • 提交

answer

#include "inv.h"

const int N = 998244354;

int invv[N];

void init(int p)
{
	invv[1] = 1;
	for (int i = 2; i <= N; i ++ )
	{
		invv[i] = (p - p / i) * invv[p % i] % p;
	}
}

int inv(int x)
{
	return invv[x];
}

详细


Pretests


Final Tests

Test #1:

score: 0
Memory Limit Exceeded

Test #2:

score: 0
Memory Limit Exceeded

Test #3:

score: 0
Memory Limit Exceeded

Test #4:

score: 0
Memory Limit Exceeded

Test #5:

score: 0
Memory Limit Exceeded