QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#128659#5. 在线 O(1) 逆元Leasier30 1844ms3820kbC++11162b2023-07-21 14:37:452024-11-05 21:50:51

Judging History

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

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

answer

#include "inv.h"

int mod;

void init(int p){
	mod = p;
}

int inv(int x){
	if (x == 1) return 1;
	return mod - 1ll * (mod / x) * inv(mod % x) % mod;
}

Details


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 19ms
memory: 3688kb

Test #2:

score: 20
Accepted
time: 1844ms
memory: 3820kb

Test #3:

score: 0
Time Limit Exceeded

Test #4:

score: 0
Time Limit Exceeded

Test #5:

score: 0
Time Limit Exceeded