結果

問題 No.1140 EXPotentiaLLL!
ユーザー kappybar
提出日時 2020-07-31 21:36:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 575 bytes
コンパイル時間 1,580 ms
コンパイル使用メモリ 166,056 KB
実行使用メモリ 17,216 KB
最終ジャッジ日時 2024-07-06 16:53:46
合計ジャッジ時間 8,653 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 1
other TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;

void solve(){
    ll a,p;
    scanf("%lld %lld",&a,&p);
    for(int i=2;i*i<=p;i++){
        if(p%i==0){printf("%d\n",-1);return;}
    }
    printf("%d\n",1);
}

int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        solve();
    }
    return 0;
}
0