結果

問題 No.1140 EXPotentiaLLL!
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-08-05 23:52:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,325 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 557 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 116,516 KB
最終ジャッジ日時 2023-10-18 22:11:36
合計ジャッジ時間 19,539 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,325 ms
116,516 KB
testcase_01 AC 1,284 ms
115,832 KB
testcase_02 AC 1,288 ms
116,140 KB
testcase_03 AC 1,259 ms
115,728 KB
testcase_04 AC 1,219 ms
115,492 KB
testcase_05 AC 1,303 ms
115,928 KB
testcase_06 AC 1,288 ms
115,844 KB
testcase_07 AC 1,319 ms
116,472 KB
testcase_08 AC 1,078 ms
114,136 KB
testcase_09 AC 1,078 ms
114,136 KB
testcase_10 AC 1,097 ms
114,136 KB
testcase_11 AC 1,092 ms
114,136 KB
testcase_12 AC 1,093 ms
114,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

MA = 5*10**6+1
s = [0]*(MA)

s[1] = 2
for i in range(2,MA):
    for j in range(i,MA,i):
        s[j] += 1
    

t = int(input())
for _ in range(t):
    a,p = map(int,input().split())
    if s[p] == 1:
        if a%p:
            print(1)
        else:
            print(0)
    else:
        print(-1)
0