QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#101625#5. 在线 O(1) 逆元chenyikai0 0ms0kbC++14170b2023-04-30 15:14:502024-11-05 21:49:07

Judging History

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

  • [2024-11-05 21:49:07]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-30 15:14:52]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-04-30 15:14:50]
  • 提交

answer

#include "inv.h"
int Inv[10000003];
void init(int p){
	Inv[1]=0;
	for(int i=2;i<=100000000;i++)Inv[i]=-1ll*Inv[p%i]*(p/i)%p+p;
}
int inv(int x){
	return Inv[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