QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#609949#5. 在线 O(1) 逆元YyyyazsCompile Error//C++14279b2024-10-04 14:32:482024-10-04 14:32:48

Judging History

你现在查看的是测评时间为 2024-10-04 14:32:48 的历史记录

  • [2024-11-05 22:04:23]
  • 管理员手动重测本题所有提交记录
  • [2024-10-04 14:32:48]
  • 评测
  • [2024-10-04 14:32:48]
  • 提交

answer

constexpr u32 mul(u32 a,u32 b){
    return u64(a)*b%998244353;
}
constexpr u32 qpw(u32 a,u32 b,u32 r=1){
    for(;b;b>>=1,a=mul(a,a)){
        if(b&1){
            r=mul(r,a);
        }
    }
    return r;
}
constexpr u32 inv(u32 x){
    return qpw(a,998244351);
}

詳細信息

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:1:11: error: ‘u32’ does not name a type
    1 | constexpr u32 mul(u32 a,u32 b){
      |           ^~~
answer.code:4:11: error: ‘u32’ does not name a type
    4 | constexpr u32 qpw(u32 a,u32 b,u32 r=1){
      |           ^~~
answer.code:12:11: error: ‘u32’ does not name a type
   12 | constexpr u32 inv(u32 x){
      |           ^~~