結果

問題 No.2323 Nafmo、A+Bをする
ユーザー shin3110
提出日時 2023-05-28 15:44:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2024-12-27 08:28:29
合計ジャッジ時間 2,222 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 11 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
t = input()

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

t = (len(s)-len(t))*'0' + t

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