QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#822642 | #5. 在线 O(1) 逆元 | BehruzbekX | Compile Error | / | / | C++20 | 275b | 2024-12-20 15:12:35 | 2024-12-20 15:12:35 |
Judging History
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