QOJ.ac

QOJ

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

Judging History

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

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

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);
}

详细

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
      |                  ^~~~