QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#534319#5. 在线 O(1) 逆元surgutti0 0ms0kbC++14238b2024-08-27 02:06:322024-11-05 22:03:15

Judging History

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

  • [2024-11-05 22:03:15]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-08-27 02:06:32]
  • 评测
  • 测评结果:0
  • 用时:890ms
  • 内存:394528kb
  • [2024-08-27 02:06:32]
  • 提交

answer

#include "inv.h"

const int N = 100000000 + 1;

int inverse[N];

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

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

Details


Pretests


Final Tests

Test #1:

score: 0
Runtime Error

Test #2:

score: 0
Runtime Error

Test #3:

score: 0
Runtime Error

Test #4:

score: 0
Runtime Error

Test #5:

score: 0
Runtime Error