結果

問題 No.2323 Nafmo、A+Bをする
ユーザー shin3110shin3110
提出日時 2023-05-28 15:40:34
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 414 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 64,512 KB
最終ジャッジ日時 2024-12-27 07:59:40
合計ジャッジ時間 2,131 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 14 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
t = input()

if s > t:
    s, t = t, s

while len(s) < len(t):
    s = '0' + s

ans = ''
for i in range(len(s)):
    if s[i] == '1':
        if t[i] == '0':
            ans += '1'
        else:
            ans += '0'
    else:
        if t[i] == '0':
            ans += '0'
        else:
            ans += '1'

z = 0
for i in range(len(ans)):
    z *= 2
    if ans[i] == '1':
        z += 1

print(z)
0