結果
| 問題 | No.1140 EXPotentiaLLL! |
| コンテスト | |
| ユーザー |
shiomusubi496
|
| 提出日時 | 2020-07-31 22:30:30 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 706 ms / 2,000 ms |
| コード長 | 432 bytes |
| 記録 | |
| コンパイル時間 | 1,082 ms |
| コンパイル使用メモリ | 181,492 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-28 09:28:48 |
| 合計ジャッジ時間 | 8,026 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 |
ソースコード
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
vector<bool> A(10000000,true);
A[0]=false,A[1]=false;
for(int i=2;i<=10000000/i;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 if(a%P==0)puts("0");
else puts("1");
}
}
shiomusubi496