QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#288055#5. 在线 O(1) 逆元ScapeGoatTreeCompile Error//C++14245b2023-12-21 17:30:352024-11-05 21:56:26

Judging History

This is the latest submission verdict.

  • [2024-11-05 21:56:26]
  • 管理员手动重测本题所有提交记录
  • [2023-12-21 17:30:36]
  • Judged
  • [2023-12-21 17:30:35]
  • Submitted

answer

#include "inv.h"
const int MOD=998244353;
const int MAXN=1e8+5;
int inv1[MOD];
void init(int p){
	inv1[1]=1;
	for(int i=2;i<=n;i++){
		int k=p/i;
		int r=p%i;
		inv1[i]=1ll*(p-k)*inv1[r]%MOD;
	}
}
int inv(int x){
	return inv1[x];
}

详细

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 ‘void init(int)’:
answer.code:7:24: error: ‘n’ was not declared in this scope
    7 |         for(int i=2;i<=n;i++){
      |                        ^