QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#23825#5. 在线 O(1) 逆元feecle6418Compile Error//C++20324b2022-03-19 16:35:042024-11-05 21:46:31

Judging History

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

  • [2024-11-05 21:46:31]
  • 管理员手动重测本题所有提交记录
  • [2024-11-05 21:43:05]
  • 管理员手动重测本题所有提交记录
  • [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:44]
  • 评测
  • [2022-03-19 16:35:04]
  • 提交

answer

#include<bits/stdc++.h>
#include"inv.h"
using namespace std;
typedef long long ll;
const int mod=998244353;
int ny[20000005];
int inv(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;
}

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: In function ‘int inv(int)’:
answer.code:9:20: error: ‘query’ was not declared in this scope
    9 |         return 1ll*query(mod%x)*(mod-mod/x)%mod;
      |                    ^~~~~