結果

問題 No.1140 EXPotentiaLLL!
ユーザー kotatsugamekotatsugame
提出日時 2020-07-31 23:52:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 277 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 63,604 KB
実行使用メモリ 12,008 KB
最終ジャッジ日時 2023-09-21 03:33:55
合計ジャッジ時間 7,578 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    5 | main()
      | ^~~~

ソースコード

diff #

#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;
		}
	}
}
0