QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#713796#5. 在线 O(1) 逆元Mango2011Compile Error//C++14338b2024-11-05 20:34:172024-11-05 22:08:14

Judging History

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

  • [2024-11-05 22:08:14]
  • 管理员手动重测本题所有提交记录
  • [2024-11-05 20:34:18]
  • 评测
  • [2024-11-05 20:34:17]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
int qp(ll x,int y){
	ll res=1;
	while(y){
		if(y&1){
			res=res*x%mod;
		}
		x=x*x%mod;
		y>>=1;
	}
	return res;
}
int inv[100005];
void init(int P){
   for(int i=0;i<100000;i++){
	   inv[i]=qp(i,mod-2);
   }
}
int inv(int x)
{
 	return inv[x];
}

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:21:14: error: ‘int inv(int)’ redeclared as different kind of entity
   21 | int inv(int x)
      |              ^
answer.code:15:5: note: previous declaration ‘int inv [100005]’
   15 | int inv[100005];
      |     ^~~