QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#216710#5. 在线 O(1) 逆元trisolarisCompile Error//C++20384b2023-10-15 21:30:062024-11-05 21:53:54

Judging History

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

  • [2024-11-05 21:53:54]
  • 管理员手动重测本题所有提交记录
  • [2023-10-15 21:30:07]
  • 评测
  • [2023-10-15 21:30:06]
  • 提交

answer

#include <bits/stdc++.h>
typedef long long ll;
const int N = 3e5 + 10, mod = 998244353;

ll rp(ll a, ll b, ll p) {
	ll res = 1;
	for( ; b; b >>= 1) {
		if(b & 1)
			res = (res * a) % p;
		a *= a, a %= p;
	}
	return res;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);

	ll n;
	std::cin >> n;
	std::cout << rp(n, mod - 2, mod) << "\n";
}

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/ccR2Zym3.o: in function `main':
answer.code:(.text.startup+0x0): multiple definition of `main'; /tmp/ccFI7Bz3.o:implementer.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccFI7Bz3.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