QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#718394#5. 在线 O(1) 逆元GuanYunchangCompile Error//C++17209b2024-11-06 20:24:102024-11-06 20:24:10

詳細信息

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:3:13: error: conversion from ‘double’ to ‘long unsigned int’ in a converted constant expression
    3 | int inv[1e8 + 1];
      |         ~~~~^~~
answer.code:3:13: error: could not convert ‘(1.0e+8 + (double)1)’ from ‘double’ to ‘long unsigned int’
    3 | int inv[1e8 + 1];
      |         ~~~~^~~
      |             |
      |             double
answer.code:3:13: error: size of array ‘inv’ has non-integral type ‘double’
answer.code:3:16: error: ‘int inv [1]’ redeclared as different kind of entity
    3 | int inv[1e8 + 1];
      |                ^
In file included from answer.code:1:
inv.h:2:5: note: previous declaration ‘int inv(int)’
    2 | int inv(int n);
      |     ^~~
answer.code: In function ‘void init(int)’:
answer.code:6:10: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    6 |     inv[0] = 1;
      |          ^
answer.code:6:12: error: assignment of read-only location ‘* inv’
    6 |     inv[0] = 1;
      |     ~~~~~~~^~~
answer.code:8:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    8 |         inv[i] = 1ll * (P - (P / i)) * inv[p % i] % P;
      |              ^
answer.code:8:25: error: ‘P’ was not declared in this scope
    8 |         inv[i] = 1ll * (P - (P / i)) * inv[p % i] % P;
      |                         ^
answer.code:8:49: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    8 |         inv[i] = 1ll * (P - (P / i)) * inv[p % i] % P;
      |                                                 ^
answer.code: In function ‘int inv(int)’:
answer.code:13:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |     return inv[x];
      |                 ^
answer.code:13:17: error: invalid conversion from ‘int (*)(int)’ to ‘int’ [-fpermissive]
   13 |     return inv[x];
      |                 ^
      |                 |
      |                 int (*)(int)