結果

問題 No.1298 OR XOR
ユーザー 👑 H20H20
提出日時 2020-11-27 21:56:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 1,973 ms
コンパイル使用メモリ 85,040 KB
実行使用メモリ 71,476 KB
最終ジャッジ日時 2023-10-01 05:34:32
合計ジャッジ時間 3,539 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,176 KB
testcase_01 AC 72 ms
71,252 KB
testcase_02 AC 73 ms
71,212 KB
testcase_03 AC 72 ms
71,204 KB
testcase_04 AC 72 ms
71,208 KB
testcase_05 AC 72 ms
71,064 KB
testcase_06 AC 71 ms
71,216 KB
testcase_07 AC 73 ms
71,476 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 71 ms
71,204 KB
testcase_11 WA -
testcase_12 AC 71 ms
71,196 KB
testcase_13 AC 71 ms
71,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
NBIT = N
cnt = 0
A = ''
B = ''
while NBIT:
    if NBIT & 1 == 1:
        cnt+=1
        if cnt % 2==0:
            A += '1'
            B += '0'
        else:
            A += '0'
            B += '1'
    else:
        A += '0'
        B += '0'
    NBIT >>= 1
if cnt%2==1:
    print(-1,-1,-1)
else:
    print(N,int(A[::-1],2) ,int(B[::-1],2))
0