結果

問題 No.1140 EXPotentiaLLL!
ユーザー ShirotsumeShirotsume
提出日時 2023-02-17 19:50:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 498 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 158,156 KB
最終ジャッジ日時 2023-09-26 17:17:31
合計ジャッジ時間 17,156 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,071 ms
158,156 KB
testcase_01 AC 1,061 ms
157,640 KB
testcase_02 WA -
testcase_03 AC 1,032 ms
156,976 KB
testcase_04 AC 967 ms
156,732 KB
testcase_05 AC 1,058 ms
157,060 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 804 ms
155,668 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 805 ms
155,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353
maxi = 10 ** 7
prime = [True] * (maxi)
prime[0] = prime[1] = False

for i in range(2, maxi):
    if prime[i]:
        for j in range(2 * i, maxi, i):
            prime[j] = False

for _ in range(ii()):
    a, p = mi()
    if prime[p]:
        print(1)
    else:
        print(-1)
0