QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#208966#5. 在线 O(1) 逆元WilliamxzhCompile Error//C++14447b2023-10-09 22:38:382024-11-05 21:52:59

Judging History

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

  • [2024-11-05 21:52:59]
  • 管理员手动重测本题所有提交记录
  • [2023-10-09 22:38:39]
  • 评测
  • [2023-10-09 22:38:38]
  • 提交

answer

#pragma GCC optimize("O2,O3,Ofast,inline,unroll-loops")
#pragma GCC target("avx2,sse4")
#include inv.h
void init(int p) ;
const int mod=998244353;
const __uint128_t brt=((__uint128_t)1<<64)/mod;
int inv(int x){
    int b=mod-2;ll ans=1ll,a=1ll*x;
    while(b){
        if(b&1){ans*=a,ans-=mod*(brt*ans>>64);while(ans>=mod) ans-=mod;}
        a*=a,a-=mod*(brt*a>>64);while(a>=mod) a-=mod;
        b>>=1;
    }
    return int(ans);
}

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:3:10: error: #include expects "FILENAME" or <FILENAME>
    3 | #include inv.h
      |          ^~~
answer.code: In function ‘int inv(int)’:
answer.code:8:17: error: ‘ll’ was not declared in this scope
    8 |     int b=mod-2;ll ans=1ll,a=1ll*x;
      |                 ^~
answer.code:10:17: error: ‘ans’ was not declared in this scope
   10 |         if(b&1){ans*=a,ans-=mod*(brt*ans>>64);while(ans>=mod) ans-=mod;}
      |                 ^~~
answer.code:10:22: error: ‘a’ was not declared in this scope
   10 |         if(b&1){ans*=a,ans-=mod*(brt*ans>>64);while(ans>=mod) ans-=mod;}
      |                      ^
answer.code:11:9: error: ‘a’ was not declared in this scope
   11 |         a*=a,a-=mod*(brt*a>>64);while(a>=mod) a-=mod;
      |         ^
answer.code:14:16: error: ‘ans’ was not declared in this scope
   14 |     return int(ans);
      |                ^~~