結果

問題 No.1140 EXPotentiaLLL!
ユーザー pluto77pluto77
提出日時 2022-06-14 14:27:08
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 322 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 74,852 KB
最終ジャッジ日時 2024-04-10 08:02:09
合計ジャッジ時間 2,647 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 58 ms
64,640 KB
testcase_09 AC 58 ms
65,280 KB
testcase_10 AC 57 ms
64,640 KB
testcase_11 AC 58 ms
64,640 KB
testcase_12 AC 58 ms
64,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1140
T=int(input())
is_prime=[True]*500002
is_prime[0]=is_prime[1]=False

for p in range(0,500002):
 if not is_prime[p]:
  continue
 for i in range(p*p,500002,p):
  is_prime[i]=False


for i in range(T):
 A,P = map(int,input().split())
 if is_prime[P]:
  if A%P==0:
   print(0)
  else:
   print(1)
 else:
  print(-1)
0