結果
問題 | No.1140 EXPotentiaLLL! |
ユーザー | 👑 rin204 |
提出日時 | 2020-08-13 07:03:47 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 542 ms / 2,000 ms |
コード長 | 508 bytes |
コンパイル時間 | 202 ms |
コンパイル使用メモリ | 82,424 KB |
実行使用メモリ | 116,492 KB |
最終ジャッジ日時 | 2024-10-09 18:56:35 |
合計ジャッジ時間 | 8,073 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 12 |
ソースコード
import sys input = sys.stdin.buffer.readline p_max = 5 * (10 ** 6) prime = [True for _ in range(p_max + 1)] prime[0] = False prime[1] = False p_max = 5 * (10 ** 6) for i in range(2, int(p_max ** 0.5) + 1): if not prime[i]: continue for j in range(2 * i, p_max + 1, i): prime[j] = False t = int(input()) for _ in range(t): a, p = map(int, input().split()) if prime[p]: if a % p == 0: print(0) else: print(1) else: print(-1)