QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#676875#5. 在线 O(1) 逆元xmseerCompile Error//C++17270b2024-10-26 01:54:212024-11-05 22:07:22

Judging History

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

  • [2024-11-05 22:07:22]
  • 管理员手动重测本题所有提交记录
  • [2024-10-26 01:54:21]
  • 评测
  • [2024-10-26 01:54:21]
  • 提交

answer

#include"inv.h"
#include<cstdio>
constexpr int N = 1e8+7;
int ans[N];

void init(int p)
{
    ans[1] = 1;
    for(int i=2;i<=N-7;i++)
    {
        ans[i] = 1ll * (p - p/i) * ans[p%i] % p;
    }
}
int inv(int x)
{
    return ans[x];
}
int main()
{

}

详细

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);
      |         ~~~~~^~~~~~~~~~
/usr/bin/ld: /tmp/cc57nJry.o: in function `main':
answer.code:(.text.startup+0x0): multiple definition of `main'; /tmp/ccypBivx.o:implementer.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status