結果

問題 No.1140 EXPotentiaLLL!
ユーザー takakintakakin
提出日時 2020-08-10 23:15:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 320 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,344 KB
実行使用メモリ 156,160 KB
最終ジャッジ日時 2024-04-17 06:49:11
合計ジャッジ時間 9,944 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 606 ms
156,160 KB
testcase_01 AC 596 ms
154,880 KB
testcase_02 WA -
testcase_03 AC 540 ms
155,116 KB
testcase_04 AC 501 ms
154,368 KB
testcase_05 AC 575 ms
155,340 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 341 ms
153,728 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 340 ms
153,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
t=int(input())
n=10**7
sieve=[-1]*(n+1)
for i in range(2,n+1):
  if sieve[i]==-1:
    sieve[i]=i
    for j in range(i*i,n+1,i):
      if sieve[j]==-1:
        sieve[j]=i
for _ in range(t):
	a,p=map(int,input().split())
	if sieve[p]==p:
		print(1)
	else:
		print(-1)
0