結果

問題 No.2323 Nafmo、A+Bをする
ユーザー tontiru
提出日時 2023-05-28 13:41:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-12-26 21:32:27
合計ジャッジ時間 2,111 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

A = input()
B = input()

if len(A)>len(B):
    lon = A
    sho = B
else:
    lon = B
    sho = A

ans = 0
for i in range(0,len(sho)):
    ans += 2**i * ((int(lon[len(lon)-1-i])+int(sho[len(sho)-1-i]))%2)


for j in range(len(sho),len(lon)):
    ans += 2**j * int(lon[len(lon)-1-j])


print(ans)

0