結果

問題 No.1140 EXPotentiaLLL!
ユーザー googol_S0googol_S0
提出日時 2020-08-01 00:27:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 839 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 972 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 190,236 KB
最終ジャッジ日時 2023-09-21 04:12:55
合計ジャッジ時間 11,798 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 839 ms
190,236 KB
testcase_01 AC 765 ms
190,044 KB
testcase_02 AC 759 ms
189,828 KB
testcase_03 AC 698 ms
170,552 KB
testcase_04 AC 630 ms
160,584 KB
testcase_05 AC 752 ms
186,368 KB
testcase_06 AC 734 ms
180,088 KB
testcase_07 AC 798 ms
189,636 KB
testcase_08 AC 418 ms
123,812 KB
testcase_09 AC 397 ms
123,728 KB
testcase_10 AC 398 ms
123,808 KB
testcase_11 AC 398 ms
123,764 KB
testcase_12 AC 409 ms
123,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
S=sys.stdin.readlines()
T=int(S[0])
A,P=0,0
PR=[1]*6000000
PR[0]=0
PR[1]=0
for i in range(2,6000000):
  if PR[i]:
    for j in range(i*2,6000000,i):
      PR[j]=0
for i in range(T):
  A,P=map(int,S[i+1].split())
  if PR[P] and A%P:
    print(1)
  elif PR[P]:
    print(0)
  else:
    print(-1)
0