結果
| 問題 |
No.8030 ミラー・ラビン素数判定法のテスト
|
| ユーザー |
👑 |
| 提出日時 | 2024-04-21 17:42:43 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 754 ms / 9,973 ms |
| コード長 | 507 bytes |
| コンパイル時間 | 5,987 ms |
| コンパイル使用メモリ | 325,660 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 16:34:28 |
| 合計ジャッジ時間 | 7,343 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <cassert> // assert
#include <iostream> // cin, cout, ios
#include <utility> // swap
#include <boost/multiprecision/miller_rabin.hpp>
namespace mp = boost::multiprecision;
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
int n;
std::cin >> n;
for(int i = 0; i < n; i++) {
unsigned long long x;
std::cin >> x;
int is_prime = (int)((x & 1) == 0 ? x == 2 : mp::miller_rabin_test(x, 20));
std::cout << x << ' ' << is_prime << '\n';
}
}