QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#822642#5. 在线 O(1) 逆元BehruzbekXCompile Error//C++20275b2024-12-20 15:12:352024-12-20 15:12:35

Judging History

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

  • [2024-12-20 15:12:35]
  • 评测
  • [2024-12-20 15:12:35]
  • 提交

answer

#include <bits/stdc++.h>

#define mod 998244353

using ll = long long;

ll bpow (ll a, ll b) {
ll r = 1;
for(;b;b>>=1, a = (a*a)%mod)if(b&1)r=(r*a)%mod;
return r;
}
ll inv(ll n){return bpow(n, mod - 2);}
int main(){
ll n;
std::cin >> n;
std::cout << inv(n);
}

詳細信息

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/ccvGSPY7.o: in function `main':
answer.code:(.text.startup+0x0): multiple definition of `main'; /tmp/ccCssNPa.o:implementer.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccCssNPa.o: in function `main':
implementer.cpp:(.text.startup+0x12b): undefined reference to `init(int)'
/usr/bin/ld: implementer.cpp:(.text.startup+0x1d0): undefined reference to `inv(int)'
collect2: error: ld returned 1 exit status