QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#718399#5. 在线 O(1) 逆元MaMengQiCompile Error//C++17226b2024-11-06 20:24:582024-11-06 20:24:59

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:4:10: error: ‘int inv [100000003]’ redeclared as different kind of entity
    4 | int inv[N];
      |          ^
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:7:10: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    7 |     inv[0] = 1;
      |          ^
answer.code:7:12: error: assignment of read-only location ‘* inv’
    7 |     inv[0] = 1;
      |     ~~~~~~~^~~
answer.code:9:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    9 |         inv[i] = 1ll * (P - (P / i)) * inv[p % i] % P;
      |              ^
answer.code:9:25: error: ‘P’ was not declared in this scope
    9 |         inv[i] = 1ll * (P - (P / i)) * inv[p % i] % P;
      |                         ^
answer.code:9:49: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    9 |         inv[i] = 1ll * (P - (P / i)) * inv[p % i] % P;
      |                                                 ^
answer.code: In function ‘int inv(int)’:
answer.code:14:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   14 |     return inv[x];
      |                 ^
answer.code:14:17: error: invalid conversion from ‘int (*)(int)’ to ‘int’ [-fpermissive]
   14 |     return inv[x];
      |                 ^
      |                 |
      |                 int (*)(int)