結果

問題 No.1140 EXPotentiaLLL!
ユーザー pluto77pluto77
提出日時 2022-06-14 14:19:38
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 322 bytes
コンパイル時間 695 ms
コンパイル使用メモリ 82,480 KB
実行使用メモリ 74,524 KB
最終ジャッジ日時 2024-04-10 07:50:59
合計ジャッジ時間 3,121 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 57 ms
65,292 KB
testcase_09 AC 57 ms
65,944 KB
testcase_10 AC 59 ms
65,132 KB
testcase_11 AC 57 ms
65,496 KB
testcase_12 AC 56 ms
65,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for p in range(0,500001):
 if not is_prime[p]:
  continue
 for i in range(p*p,500001,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