結果
| 問題 | No.1298 OR XOR | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-10-17 18:25:51 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 31 ms / 2,000 ms | 
| コード長 | 326 bytes | 
| コンパイル時間 | 88 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,624 KB | 
| 最終ジャッジ日時 | 2024-06-28 08:35:34 | 
| 合計ジャッジ時間 | 1,515 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 13 | 
ソースコード
def main():
    N = int(input())
    N_bit = format(N, "b")
    if N_bit.count("1") == 1:
        print("-1 -1 -1")
        return
    A = N
    most_right_on_bit = N_bit.find("1")
    C = "0b1" + "0" * (len(N_bit) - most_right_on_bit - 1)
    C = int(C, 0)
    print(f"{A} {A-C} {C}")
if __name__ == "__main__":
    main()
            
            
            
        