QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#713831#5. 在线 O(1) 逆元Mango2011Compile Error//C++20264b2024-11-05 20:39:032024-11-05 20:39:04

Judging History

你现在查看的是测评时间为 2024-11-05 20:39:04 的历史记录

  • [2024-11-05 22:08:16]
  • 管理员手动重测本题所有提交记录
  • [2024-11-05 20:39:04]
  • 评测
  • [2024-11-05 20:39:03]
  • 提交

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;
}
void init(int p){
	
}
int inv(int x){
 	return qp(i,mod-2);
}

详细

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: In function ‘int inv(int)’:
answer.code:19:19: error: ‘i’ was not declared in this scope
   19 |         return qp(i,mod-2);
      |                   ^