Asa's CP Library

a01sa01to's competitive programming library.

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub a01sa01to/cp-library

:heavy_check_mark: tests/math/miller-rabin/libchecker.test.cpp

Depends on

Code

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

#include "../../../cpp/library/math/miller-rabin.hpp"
#define PROBLEM "https://judge.yosupo.jp/problem/primality_test"

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  int q;
  cin >> q;
  while (q--) {
    ull n;
    cin >> n;
    cout << (asalib::math::miller_rabin_test(n) ? "Yes" : "No") << '\n';
  }
  return 0;
}
Back to top page