QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#128659#5. 在线 O(1) 逆元Leasier70 1861ms3712kbC++11162b2023-07-21 14:37:452023-07-21 14:37:52

Judging History

你现在查看的是测评时间为 2023-07-21 14:37:52 的历史记录

  • [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

Test #1:

score: 30
Accepted
time: 17ms
memory: 3604kb

Test #2:

score: 40
Accepted
time: 1861ms
memory: 3712kb

Test #3:

score: 0
Time Limit Exceeded