QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#738320#5. 在线 O(1) 逆元dqwCompile Error//C++23674b2024-11-12 18:41:052024-11-12 18:41:05

Judging History

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

  • [2024-11-12 18:41:05]
  • 评测
  • [2024-11-12 18:41:05]
  • 提交

answer

//  __  __   _  _____ _   _   _____   ______          __
//  \ \/ /  / \|_   _| | | | |  __ \ / __ \ \   /\   / /
//   \  /  / _ \ | | | | | | | |  | | |  | \ \ /  \ / /
//   /  \ / ___ \| | | |_| | | |__| | |__| |\ V /\ V /
//  /_/\_/_/   \_\_|  \___/  |_____/ \___\_\ \_/  \_/ (TM)

#include <bits/stdc++.h>
#include "inv.h"
using namespace std;
#define ll long long
int inv(ll int a, ll int m = 998244353)
{
    ll int u = 0, v = 1;
    while (a != 0)
    {
        ll int t = m / a;
        m -= t * a;
        swap(a, m);
        u -= t * v;
        swap(u, v);
    }
    return (1ll * u + 998244353) % 998244353;
}
void init(int p){
	return;
}

详细

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/ccapPXsK.o: in function `main':
implementer.cpp:(.text.startup+0x1d0): undefined reference to `inv(int)'
collect2: error: ld returned 1 exit status