結果
問題 | No.1140 EXPotentiaLLL! |
ユーザー |
|
提出日時 | 2020-07-31 22:15:57 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 665 bytes |
コンパイル時間 | 362 ms |
コンパイル使用メモリ | 82,424 KB |
実行使用メモリ | 90,664 KB |
最終ジャッジ日時 | 2024-07-06 18:35:12 |
合計ジャッジ時間 | 7,429 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | TLE * 1 -- * 11 |
ソースコード
def main():import sysinput = sys.stdin.buffer.readlinedef is_prime(n):"""input: n > 0output: True if n is prime,otherwise False"""if n == 1:return Falsefor i in range(2, n+1):if i*i > n:breakif n % i == 0:return Falsereturn TrueT = int(input())for _ in range(T):A, P = (int(i) for i in input().split())if not is_prime(P):print(-1)continueif A % P != 0:print(1)else:print(0)if __name__ == '__main__':main()