結果

問題 No.1140 EXPotentiaLLL!
ユーザー mmn15277198mmn15277198
提出日時 2021-06-07 21:49:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 406 bytes
コンパイル時間 1,621 ms
コンパイル使用メモリ 166,672 KB
実行使用メモリ 11,904 KB
最終ジャッジ日時 2024-05-03 22:35:58
合計ジャッジ時間 7,805 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 80 ms
11,776 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int MX = 2200000;
int main() {
  vector<int> prime(MX , 0);
  for (int i = 2; i < MX; i++) {
    for (int j = i; j < MX; j += i) {
      prime[j]++;
    }
  }
  int t;
  cin >> t;
  while (t--) {
    long long a;
    int p;
    cin >> a >> p;
    if (prime[p] > 1) {
      cout << -1 << endl;
    } else {
      cout << 1 << endl;
    }
  }
  return 0;
}
0