結果

問題 No.1140 EXPotentiaLLL!
ユーザー syunsukesyunsuke
提出日時 2020-09-16 22:23:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 118,436 KB
最終ジャッジ日時 2023-09-04 04:05:39
合計ジャッジ時間 8,695 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 542 ms
117,484 KB
testcase_01 AC 548 ms
117,024 KB
testcase_02 WA -
testcase_03 AC 523 ms
116,764 KB
testcase_04 AC 481 ms
116,236 KB
testcase_05 AC 555 ms
116,656 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 332 ms
115,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 318 ms
115,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

P=[0 for i in range(5*10**6+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**6:
                break
            else:
                P[i*j]=1
import sys
input=sys.stdin.readline
Q=int(input())
for q in range(Q):
    A,T=map(int,input().split())
    if P[T]==0:
        print(1)
    else:
        print(-1)
            
0