結果

問題 No.1140 EXPotentiaLLL!
ユーザー SSlimeSSlime
提出日時 2020-07-31 21:35:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 124,780 KB
最終ジャッジ日時 2023-09-20 22:06:41
合計ジャッジ時間 8,104 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 514 ms
123,376 KB
testcase_01 AC 486 ms
124,780 KB
testcase_02 WA -
testcase_03 AC 444 ms
123,028 KB
testcase_04 AC 397 ms
121,228 KB
testcase_05 AC 468 ms
124,524 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 282 ms
115,224 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 282 ms
115,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

furui = [1]*(5*10**6+1)
furui[0] = furui[1] = 0
for i in range(5*10**6+1):
    if furui[i]:
        x = 2*i
        while x <= 5*10**6:
            furui[x] = 0
            x += i

t = int(input())
ans = [-1]*t
for i in range(t):
    a,p = map(int,input().split())
    if furui[p]:
        ans[i] = 1
print("\n".join(str(i) for i in ans))
0