QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#822637 | #5. 在线 O(1) 逆元 | BehruzbekX | Compile Error | / | / | C++14 | 264b | 2024-12-20 15:11:11 | 2024-12-20 15:11:11 |
Judging History
This is the latest submission verdict.
- [2024-12-20 15:11:11]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-12-20 15:11:11]
- Submitted
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;
cin >> n;
cout < inv(n);
}
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 main()’: answer.code:15:1: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 15 | cin >> n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:146, from answer.code:1: /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ answer.code:16:1: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 16 | cout < inv(n); | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~