結果
問題 |
No.1140 EXPotentiaLLL!
|
ユーザー |
|
提出日時 | 2021-09-18 11:26:34 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 514 bytes |
コンパイル時間 | 193 ms |
コンパイル使用メモリ | 82,768 KB |
実行使用メモリ | 76,728 KB |
最終ジャッジ日時 | 2024-06-30 08:37:07 |
合計ジャッジ時間 | 2,563 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 RE * 8 |
ソースコード
#!/usr/bin/env python3 import sys readline = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 7) def eratosthenes(n): a = [True] * n a[0] = False a[1] = False for i in range(2, n): if not a[i]: continue for j in range(2, (n - 1) // i + 1): a[i * j] = False return a t = int(input()) pr = eratosthenes(500001) for _ in range(t): a, p = map(int, input().split()) if pr[p]: print(0 if a % p == 0 else 1) else: print(-1)