結果

問題 No.1140 EXPotentiaLLL!
ユーザー zkouzkou
提出日時 2020-07-31 21:31:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 117,408 KB
最終ジャッジ日時 2023-09-20 21:48:01
合計ジャッジ時間 8,963 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 572 ms
117,408 KB
testcase_01 AC 574 ms
116,616 KB
testcase_02 WA -
testcase_03 AC 544 ms
116,720 KB
testcase_04 AC 516 ms
116,436 KB
testcase_05 AC 583 ms
116,620 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 395 ms
115,980 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline

table_len = 5000005
table = [True] * table_len
for i in range(2, table_len):
    if table[i]:
        for j in range(2*i, table_len, i):
            table[j] = False

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