結果

問題 No.2323 Nafmo、A+Bをする
ユーザー shin3110shin3110
提出日時 2023-05-28 15:44:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 71,632 KB
最終ジャッジ日時 2023-08-27 12:51:18
合計ジャッジ時間 2,890 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 78 ms
71,116 KB
testcase_02 AC 76 ms
71,080 KB
testcase_03 AC 77 ms
71,084 KB
testcase_04 AC 77 ms
71,324 KB
testcase_05 WA -
testcase_06 AC 75 ms
71,388 KB
testcase_07 AC 74 ms
71,488 KB
testcase_08 AC 76 ms
71,208 KB
testcase_09 AC 75 ms
71,372 KB
testcase_10 AC 76 ms
71,392 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 77 ms
71,332 KB
testcase_14 WA -
testcase_15 AC 76 ms
71,196 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 76 ms
71,400 KB
testcase_19 AC 76 ms
71,472 KB
権限があれば一括ダウンロードができます

ソースコード

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