QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#676872#5. 在线 O(1) 逆元xmseerCompile Error//C++17273b2024-10-26 01:53:102024-11-05 22:07:22

Judging History

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

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

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()
{
    
}

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: In function ‘void init(int)’:
answer.code:11:48: error: expected ‘;’ before ‘}’ token
   11 |         ans[i] = 1ll * (p - p/i) * ans[p%i] % p
      |                                                ^
      |                                                ;
   12 |     }
      |     ~