結果

問題 No.1140 EXPotentiaLLL!
ユーザー chineristAC
提出日時 2020-07-31 21:50:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 148,352 KB
最終ジャッジ日時 2024-07-06 17:41:27
合計ジャッジ時間 6,999 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 6
権限があれば一括ダウンロードができます

ソースコード

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