結果
| 問題 | No.8030 ミラー・ラビン素数判定法のテスト |
| ユーザー |
tabr
|
| 提出日時 | 2020-05-06 16:55:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 661 bytes |
| 記録 | |
| コンパイル時間 | 1,396 ms |
| コンパイル使用メモリ | 166,792 KB |
| 実行使用メモリ | 10,020 KB |
| 最終ジャッジ日時 | 2024-11-18 17:54:19 |
| 合計ジャッジ時間 | 67,857 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 TLE * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif
bool is_prime(unsigned long long n) {
if (n <= 1) {
return false;
}
for (long long i = 2; i * i <= n; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
ll x;
cin >> x;
cout << x << " ";
int j = 0;
if (is_prime(x)) {
j = 1;
}
cout << j << '\n';
}
return 0;
}
tabr