結果

問題 No.1140 EXPotentiaLLL!
ユーザー shiomusubi496
提出日時 2020-07-31 22:27:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 1,475 ms
コンパイル使用メモリ 168,600 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 18:53:49
合計ジャッジ時間 12,423 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 6
権限があれば一括ダウンロードができます

ソースコード

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