結果

問題 No.1140 EXPotentiaLLL!
ユーザー syunsukesyunsuke
提出日時 2020-09-16 22:18:48
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 371 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 84,336 KB
最終ジャッジ日時 2023-09-04 04:04:01
合計ジャッジ時間 4,036 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 100 ms
79,828 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 99 ms
80,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

P=[0 for i in range(5*10**5+1)]
P[0]=1
P[1]=1
#print(len(P))
for i in range(2,len(P)):
    if P[i]==0:
        for j in range(2,len(P)):
            if i*j>5*10**5:
                break
            else:
                P[i*j]=1

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