結果

問題 No.353 ヘイトプラス
ユーザー calei
提出日時 2020-02-01 04:50:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 367 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-18 19:29:58
合計ジャッジ時間 980 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

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