結果
問題 | No.1140 EXPotentiaLLL! |
ユーザー |
|
提出日時 | 2020-07-31 21:42:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 571 bytes |
コンパイル時間 | 1,522 ms |
コンパイル使用メモリ | 167,120 KB |
実行使用メモリ | 17,088 KB |
最終ジャッジ日時 | 2024-07-06 17:12:01 |
合計ジャッジ時間 | 8,447 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | TLE * 1 -- * 11 |
ソースコード
#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; cin >> a >> p; for(ll i=2;i*i<=p;i++){ if(p%i==0){cout << -1 << endl;return;} } cout << 1 << endl; return; } int main(){ int t; cin >> t; while(t--){ solve(); } return 0; }