QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#640546#5. 在线 O(1) 逆元Yu_mxCompile Error//C++14369b2024-10-14 14:10:372024-11-05 22:05:19

Judging History

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

  • [2024-11-05 22:05:19]
  • 管理员手动重测本题所有提交记录
  • [2024-10-14 14:10:37]
  • 评测
  • [2024-10-14 14:10:37]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl '\n'
#include<inv.h>

int mod;

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

int inv(int x){
	int p = mod;
	int k = p-2;
	int res = 1%p;
	while(k){
		if(k&1) res = 1LL*res*a%p;
		k >>= 1;
		a = 1LL*a*a%p;
	}
	return res;
}

Details

implementer.cpp: In function ‘int main()’:
implementer.cpp:22:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
answer.code:6:9: fatal error: inv.h: No such file or directory
    6 | #include<inv.h>
      |         ^~~~~~~
compilation terminated.