結果
問題 |
No.1140 EXPotentiaLLL!
|
ユーザー |
|
提出日時 | 2020-12-08 12:18:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 548 bytes |
コンパイル時間 | 1,566 ms |
コンパイル使用メモリ | 167,660 KB |
実行使用メモリ | 16,952 KB |
最終ジャッジ日時 | 2024-09-17 14:33:58 |
合計ジャッジ時間 | 9,125 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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(); } }