結果
問題 | No.1140 EXPotentiaLLL! |
ユーザー |
|
提出日時 | 2020-07-31 21:40:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 586 bytes |
コンパイル時間 | 1,637 ms |
コンパイル使用メモリ | 166,432 KB |
実行使用メモリ | 17,208 KB |
最終ジャッジ日時 | 2024-07-06 17:05:41 |
合計ジャッジ時間 | 8,300 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; scanf("%lld %lld",&a,&p); for(ll i=2;i*i<=p;i++){ if(p%i==0){printf("%d\n",-1);return;} } printf("%d\n",1); return; } int main(){ int t; scanf("%d",&t); while(t--){ solve(); } return 0; }