結果

問題 No.1140 EXPotentiaLLL!
ユーザー shiomusubi496shiomusubi496
提出日時 2020-07-31 22:27:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 1,638 ms
コンパイル使用メモリ 165,964 KB
実行使用メモリ 4,400 KB
最終ジャッジ日時 2023-09-21 00:07:52
合計ジャッジ時間 13,076 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    vector<bool> A(10000000,true);
    A[0]=0,A[1]=0;
    for(int i=2;i<10000000;i++){
        if(!A[i])continue;
        for(int j=i*2;j<10000000;j+=i)A[j]=false;
    }
    int T;
    cin>>T;
    while(T--){
        int a,P;
        cin>>a>>P;
        if(!A[P])puts("-1");
        else puts("1");
    }
}
0