結果

問題 No.1140 EXPotentiaLLL!
ユーザー 👑 deuteridayodeuteridayo
提出日時 2020-12-08 12:18:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 548 bytes
コンパイル時間 1,756 ms
コンパイル使用メモリ 167,388 KB
実行使用メモリ 14,860 KB
最終ジャッジ日時 2023-10-17 17:08:47
合計ジャッジ時間 11,570 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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>
// #include<atcoder/all>
using namespace std;
// using namespace atcoder;
using lint = long long;
long const mod = 1e9+7;
//long const mod = 998244353;
void solve(){
    lint a,p;
    cin >> a >> p;
    for(int i=2;i<=sqrt(p);i++){
        if(p%i == 0){
            cout << -1 << endl;
            return;
        }
    }
    if(a%p==0){
        cout << 0 << endl;
        return;
    }else{
        cout << 1 << endl;
    }

    



}
int main(){
    lint t;
    cin >> t;
    for(int i=0;i<t;i++){
        solve();
    }
}
0