結果
| 問題 | No.1140 EXPotentiaLLL! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-18 11:23:58 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 429 bytes |
| 記録 | |
| コンパイル時間 | 889 ms |
| コンパイル使用メモリ | 85,224 KB |
| 実行使用メモリ | 134,776 KB |
| 最終ジャッジ日時 | 2026-03-20 04:14:04 |
| 合計ジャッジ時間 | 19,120 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 TLE * 3 |
ソースコード
#!/usr/bin/env python3
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
def is_prime(n):
if n <= 1:
return False
i = 2
while i * i <= n:
if n % i == 0:
return False
i += 1
return True
t = int(input())
for _ in range(t):
a, p = map(int, input().split())
if is_prime(p):
print(0 if a % p == 0 else 1)
else:
print(-1)