結果

問題 No.984 Inversion
ユーザー lam6er
提出日時 2025-03-20 18:47:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 141 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 82,600 KB
実行使用メモリ 53,884 KB
最終ジャッジ日時 2025-03-20 18:48:18
合計ジャッジ時間 2,205 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

P, N = map(int, input().split())
if P == 2:
    print(0)
else:
    d = math.gcd(N, P-1)
    ans = (P - 1 - d) % 2
    print(ans)
0