QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#712932#5. 在线 O(1) 逆元liuenciCompile Error//C++14176b2024-11-05 17:31:382024-11-05 22:08:02

详细

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 ‘void init(int)’:
answer.code:6:29: warning: iteration 10000008 invokes undefined behavior [-Waggressive-loop-optimizations]
    6 | for(int i=2;i<=n;i++) inv[i]=1LL*(P-P/i)*inv[P%i]%P;
      |                       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
answer.code:6:14: note: within this loop
    6 | for(int i=2;i<=n;i++) inv[i]=1LL*(P-P/i)*inv[P%i]%P;
      |             ~^~~
/usr/bin/ld: /tmp/ccKLFse4.o: in function `main':
implementer.cpp:(.text.startup+0x1d0): undefined reference to `inv(int)'
collect2: error: ld returned 1 exit status