結果

問題 No.1140 EXPotentiaLLL!
ユーザー pluto77pluto77
提出日時 2022-06-14 14:31:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 517 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 117,456 KB
最終ジャッジ日時 2024-04-10 08:06:24
合計ジャッジ時間 7,295 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 485 ms
116,876 KB
testcase_01 AC 473 ms
116,280 KB
testcase_02 AC 449 ms
117,456 KB
testcase_03 AC 435 ms
115,884 KB
testcase_04 AC 386 ms
115,760 KB
testcase_05 AC 470 ms
116,060 KB
testcase_06 AC 452 ms
116,076 KB
testcase_07 AC 517 ms
117,132 KB
testcase_08 AC 246 ms
113,180 KB
testcase_09 AC 265 ms
113,056 KB
testcase_10 AC 262 ms
113,156 KB
testcase_11 AC 256 ms
113,300 KB
testcase_12 AC 267 ms
113,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1140
import sys
input=sys.stdin.readline
prime=[1]*5000001
prime[0]=prime[1]=0
for i in range(2,5000001):
  if prime[i]:
    for j in range(i+i,5000001,i):
     prime[j]=0
for _ in range(int(input())):
  a,p=map(int,input().split())
  if prime[p]:
    if a%p:
     print(1)
    else:
     print(0)
  else:
   print(-1)
0