QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#23824#5. 在线 O(1) 逆元feecle6418Compile Error//C++20326b2022-03-19 16:32:022024-11-05 21:46:29

Judging History

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

  • [2024-11-05 21:46:29]
  • 管理员手动重测本题所有提交记录
  • [2024-11-05 21:43:04]
  • 管理员手动重测本题所有提交记录
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-18 04:14:38]
  • 评测
  • [2022-03-19 16:32:02]
  • 提交

answer

#include<bits/stdc++.h>
#include"inv.h"
using namespace std;
typedef long long ll;
const int mod=998244353;
int ny[20000005];
int query(int x){
	if(x<=20000000)return ny[x];
	return 1ll*query(mod%x)*(mod-mod/x)%mod;
}
void init(int p){
	ny[1]=1;
	for(int i=2;i<=20000000;i++)ny[i]=1ll*ny[mod%i]*(mod-mod/i)%mod;
}

詳細信息

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);
      |         ~~~~~^~~~~~~~~~
/usr/bin/ld: /tmp/cc6va87Y.o: in function `main':
implementer.cpp:(.text.startup+0x1d0): undefined reference to `inv(int)'
collect2: error: ld returned 1 exit status