QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#919680#5. 在线 O(1) 逆元yzy4090#0 0ms0kbC++14223b2025-02-28 12:02:372025-02-28 12:02:42

Judging History

This is the latest submission verdict.

  • [2025-02-28 12:02:42]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 0kb
  • [2025-02-28 12:02:37]
  • Submitted

answer

#include "inv.h"
#include<bits/stdc++.h>
typedef long long ll;
const int N=1e8+5;
int in[N];
void init(int p){
	in[1]=1;
	for(int i=2;i<=1e8;i++)
		in[i]=(ll)in[p%i]*(p-p/i)%p;
}
int inv(int a){
	return in[a];
}

详细


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