結果

問題 No.353 ヘイトプラス
ユーザー caleicalei
提出日時 2020-02-01 04:50:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 367 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 11,976 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2023-10-18 23:31:21
合計ジャッジ時間 1,560 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,240 KB
testcase_01 AC 31 ms
10,240 KB
testcase_02 AC 31 ms
10,240 KB
testcase_03 AC 30 ms
10,240 KB
testcase_04 AC 31 ms
10,240 KB
testcase_05 AC 30 ms
10,240 KB
testcase_06 AC 30 ms
10,240 KB
testcase_07 AC 29 ms
10,240 KB
testcase_08 AC 30 ms
10,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# yukicoder No.353 ヘイトプラス 2020/02/01

a,b=map(int,input().split())
a=bin(a)[2:]
b=bin(b)[2:]
n=max(len(a),len(b))
a=a.zfill(n)
b=b.zfill(n)
a=a[::-1]
b=b[::-1]
res=[]

c=0
for x,y in zip(a,b):
    x,y=int(x),int(y)
    res.append(x^y^c)
    c=1 if [x,y,c].count(1)>1 else 0
else:
    res.append(c)
res=res[::-1]
ans=int(''.join(map(str,res)),2)
print(ans)
0