QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#624694#5. 在线 O(1) 逆元dww_13370 0ms0kbC++14232b2024-10-09 16:26:422024-11-05 22:04:36

Judging History

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

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

answer

#include "inv.h"

const int MAXN = 1e8 + 7;
int invt[MAXN];

void init(int p)
{
	invt[1] = 1;
	for(int i = 1 ; i <= MAXN ; i++) invt[i] = (long long)(p - p / i) * invt[p % i] % p;
}

int inv(int x)
{
	return invt[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