結果
問題 | No.2323 Nafmo、A+Bをする |
ユーザー |
|
提出日時 | 2023-05-28 13:46:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 37 ms / 2,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 284 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-26 21:48:29 |
合計ジャッジ時間 | 1,539 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
s=input()[::-1]t=input()[::-1]if len(s)>len(t):t+="0"*(len(s)-len(t))if len(s)<len(t):s+="0"*(len(t)-len(s))ans=""for i in range(len(s)):if s[i]=="0":if t[i]=="1":ans+="1"else:ans+="0"else:if t[i]=="1":ans+="0"else:ans+="1"a=0for i in range(len(s)):a+=int(ans[i])*pow(2,i)print(a)