QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#650550#5. 在线 O(1) 逆元yduckCompile Error//C++14758b2024-10-18 15:34:372024-10-18 15:34:39

Judging History

你现在查看的是测评时间为 2024-10-18 15:34:39 的历史记录

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

answer

#include<bits/stdc++.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);
      |         ~~~~~^~~~~~~~~~
/usr/bin/ld: /tmp/cc2PlNr5.o: in function `main':
implementer.cpp:(.text.startup+0x12b): undefined reference to `init(int)'
/usr/bin/ld: implementer.cpp:(.text.startup+0x1d0): undefined reference to `inv(int)'
collect2: error: ld returned 1 exit status