結果

問題 No.1140 EXPotentiaLLL!
ユーザー chineristACchineristAC
提出日時 2020-07-31 21:50:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 151,784 KB
最終ジャッジ日時 2023-09-20 22:54:57
合計ジャッジ時間 9,433 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 566 ms
150,964 KB
testcase_01 AC 553 ms
151,408 KB
testcase_02 WA -
testcase_03 AC 526 ms
150,704 KB
testcase_04 AC 494 ms
150,712 KB
testcase_05 AC 566 ms
151,552 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 386 ms
150,892 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 367 ms
151,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

prime=set([])

def factorization(n):
    res=[0 for i in range(n+1)]
    for i in range(2,n+1):
        if not res[i]:
            prime.add(i)
            for j in range(1,(n)//i+1):
                res[i*j]+=1

factorization(5*10**6)

import sys

input=sys.stdin.buffer.readline
for _ in range(int(input())):
    a,p=map(int,input().split())
    if p in prime:
        print(1)
    else:
        print(-1)
0