結果

問題 No.984 Inversion
ユーザー lam6er
提出日時 2025-03-20 20:33:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 141 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 82,216 KB
実行使用メモリ 54,176 KB
最終ジャッジ日時 2025-03-20 20:34:51
合計ジャッジ時間 2,196 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