結果

問題 No.1140 EXPotentiaLLL!
ユーザー DrDrpilot
提出日時 2022-03-03 15:59:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 434 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 82,604 KB
実行使用メモリ 90,224 KB
最終ジャッジ日時 2024-07-17 12:20:53
合計ジャッジ時間 8,851 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 1
other TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def isprime(n):
    if n < 2:
        return False
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        if n % i == 0: return False
    return True
t=int(input())
for _ in range(t):
    a,p=map(int,input().split())
    if isprime(p)==False:
        print(-1)
    else:
        if a%p==0:
            print(0)
        else:
            print(1)
0