結果

問題 No.1298 OR XOR
ユーザー uni_pythonuni_python
提出日時 2020-12-05 16:22:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 71,332 KB
最終ジャッジ日時 2023-10-13 22:14:39
合計ジャッジ時間 2,440 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,036 KB
testcase_01 AC 69 ms
71,040 KB
testcase_02 AC 71 ms
71,332 KB
testcase_03 AC 76 ms
71,024 KB
testcase_04 AC 70 ms
71,040 KB
testcase_05 AC 71 ms
71,004 KB
testcase_06 AC 71 ms
71,240 KB
testcase_07 AC 72 ms
70,748 KB
testcase_08 AC 72 ms
70,900 KB
testcase_09 AC 71 ms
70,748 KB
testcase_10 AC 71 ms
70,948 KB
testcase_11 AC 72 ms
70,896 KB
testcase_12 AC 73 ms
71,252 KB
testcase_13 AC 72 ms
70,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))


mod=10**9+7
N=I()

Nb=bin(N)[2:]

if Nb.count("1")==1:
    print(-1,-1,-1)
else:
    C=N
    A=0
    B=0
    flag=0
    for i in range(35):#i桁目
        if (N>>i)&1:
            if flag:
                B+=(1<<i)
            else:
                A+=(1<<i)
                flag=1
    print(A,B,C)
            
                
0