結果
| 問題 | No.1140 EXPotentiaLLL! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-08 12:18:12 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 548 bytes |
| 記録 | |
| コンパイル時間 | 970 ms |
| コンパイル使用メモリ | 179,900 KB |
| 実行使用メモリ | 9,728 KB |
| 最終ジャッジ日時 | 2026-04-06 08:02:54 |
| 合計ジャッジ時間 | 8,144 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | TLE * 1 -- * 11 |
ソースコード
#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();
}
}