結果

問題 No.1140 EXPotentiaLLL!
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2024-01-06 00:31:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 471 bytes
コンパイル時間 2,045 ms
コンパイル使用メモリ 201,656 KB
実行使用メモリ 16,680 KB
最終ジャッジ日時 2024-01-06 00:31:43
合計ジャッジ時間 10,525 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

vector<bool> prime;

bool is_prime(ll N){
    if (N == 0 || N == 1) return false;
    for (ll i=2; i*i<=N; i++){
        if (N % i == 0) return false;
    }
    return true;
}

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

    ll T, A, N;
    cin >> T;
    while(T){
        T--;
        cin >> A >> N;
        cout << (is_prime(N) ? 1 : -1) << '\n';
    }

    return 0;
}
0