結果

問題 No.1298 OR XOR
ユーザー proribone
提出日時 2020-11-27 21:27:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 248 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-07-23 22:03:18
合計ジャッジ時間 1,490 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def popcount(x):
    s=set()
    cnt=0
    while(x>0):
        if x%2:
            s.add(cnt)
        x//=2
        cnt+=1
    return s

N=int(input())

s=popcount(N)

if len(s)==1:
    print(-1,-1,-1)
else:
    t=s.pop()
    print(N,1<<t,N-(1<<t))
0