結果

問題 No.1298 OR XOR
ユーザー TomoyarnTomoyarn
提出日時 2022-02-03 05:59:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 71,600 KB
最終ジャッジ日時 2023-09-02 03:03:52
合計ジャッジ時間 2,630 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,572 KB
testcase_01 AC 75 ms
71,324 KB
testcase_02 AC 75 ms
71,268 KB
testcase_03 AC 76 ms
71,196 KB
testcase_04 AC 75 ms
71,584 KB
testcase_05 AC 75 ms
71,336 KB
testcase_06 AC 77 ms
71,580 KB
testcase_07 AC 75 ms
71,476 KB
testcase_08 AC 72 ms
71,240 KB
testcase_09 AC 74 ms
71,256 KB
testcase_10 AC 74 ms
71,600 KB
testcase_11 AC 74 ms
71,476 KB
testcase_12 AC 74 ms
71,392 KB
testcase_13 AC 75 ms
71,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def yukicoder1298(i):
    C = i
    Ch = bin(i)[2:]
#    print(Ch, Ch.count('1'))
    if Ch.count('1') > 1:
        j = 1
        while True:
            if Ch[-j] == '1':
                break
            j += 1
        B = 2 ** (j - 1)
        A = C ^ B
        print(A, B, C)
    else:
        print(-1, -1, -1)
        
    
i = int(input())
yukicoder1298(i)
0