QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#650567#5. 在线 O(1) 逆元yduckCompile Error//C++14750b2024-10-18 15:37:272024-11-05 22:06:32

Judging History

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

  • [2024-11-05 22:06:32]
  • 管理员手动重测本题所有提交记录
  • [2024-10-18 15:37:28]
  • 评测
  • [2024-10-18 15:37:27]
  • 提交

answer

#include<inv.h>
using namespace std;

#define pb push_back
#define fi first
#define se second
#define rep(i, l, r) for(int i = (l); i <= (r); i ++)
#define per(i, r, l) for(int i = (r); i >= (l); i --)
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define looktime cerr << endl << 1.0 * clock() / CLOCKS_PER_SEC << endl;
#define mp make_pair
typedef pair<int, int> pii;
//---------------------------------------------------------------------------
#define int long long

int mo;

int qpow(int x, int n, int p){
  int res = 1;
  while(n){
    if(n & 1) res = res * x % p;
    x = x * x % p;
    n >>= 1;
  }
  return res;
}

int inv(int x){
  return qpow(x, mo - 2, mo);
}

void iniv(int p){
  mo = p;
}

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:1:9: fatal error: inv.h: No such file or directory
    1 | #include<inv.h>
      |         ^~~~~~~
compilation terminated.