QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#917954#5. 在线 O(1) 逆元Shumomo#0 0ms0kbC++14184b2025-02-27 16:13:192025-02-27 16:13:21

Judging History

This is the latest submission verdict.

  • [2025-02-27 16:13:21]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 0kb
  • [2025-02-27 16:13:19]
  • Submitted

answer

#include "inv.h"
int in[100000009];
void init(int p){
    long long mod=p;
    in[1]=1;
    for(int i=2;i<=100000000;i++)in[i]=(p-p/i)*in[p%i]%p;
}
int inv(int x){return in[x];}

Details


Pretests


Final Tests

Test #1:

score: 0
Runtime Error

Test #2:

score: 0
Runtime Error

Test #3:

score: 0
Runtime Error

Test #4:

score: 0
Runtime Error

Test #5:

score: 0
Runtime Error