結果
問題 |
No.1140 EXPotentiaLLL!
|
ユーザー |
|
提出日時 | 2020-07-31 23:52:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 277 bytes |
コンパイル時間 | 538 ms |
コンパイル使用メモリ | 63,600 KB |
実行使用メモリ | 13,824 KB |
最終ジャッジ日時 | 2024-07-06 22:13:01 |
合計ジャッジ時間 | 7,760 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | TLE * 1 -- * 11 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int T; long A,P; main() { cin>>T; for(;T--;) { cin>>A>>P; bool isp=true; if(P==1)isp=false; for(int i=2;i*i<=P;i++)if(P%i==0)isp=false; if(isp) { A%=P; cout<<(A?1:0)<<endl; } else { cout<<-1<<endl; } } }