結果
問題 | No.2323 Nafmo、A+Bをする |
ユーザー |
![]() |
提出日時 | 2023-05-28 14:06:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 61 ms / 2,000 ms |
コード長 | 1,768 bytes |
コンパイル時間 | 488 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 55,424 KB |
最終ジャッジ日時 | 2024-12-26 23:24:23 |
合計ジャッジ時間 | 2,466 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
from sys import stdininput = stdin.readlinefrom functools import lru_cache@lru_cache(maxsize=1000)def next():x = input().rstrip()return(x)def nextint():x = int(input())return(x)def nextfloat():x = float(input())return(x)def nextlist():x = list(input().rstrip().split())return(x)def nextintlist():x = list(map(int, input().rstrip().split()))return(x)def nextfloatlist():x = list(map(float, input().rstrip().split()))return(x)def nextlist2():n = int(input()) # nは入力回数x = [input().rstrip() for _ in range(n)]return(x)def nextintlist2():n = int(input()) # nは入力回数x = [int(input()) for _ in range(n)]return(x)def nextfloatlist2():n = int(input()) # nは入力回数x = [float(input()) for _ in range(n)]return(x)def nextdoublelist():n = int(input()) # nは入力回数x = [list(input().rstrip().split()) for _ in range(n)]return(x)def nextdoubleintlist():n = int(input()) # nは入力回数x = [list(map(int, input().rstrip().split())) for _ in range(n)]return(x)def nextdoublefloatlist():n = int(input()) # nは入力回数x = [list(map(float, input().rstrip().split())) for _ in range(n)]return(x)s1 = list(next())s2 = list(str(nextint()))s = []a = 0if len(s1) >= len(s2):for i in range(len(s1) - len(s2)):s2.insert(0,"0")elif len(s1) <= len(s2):for i in range(len(s2) - len(s1)):s1.insert(0,"0")for i in range(len(s1)):if int(s1[i]) + int(s2[i]) == 0:s += "0"elif int(s1[i]) + int(s2[i]) == 2:s += "0"elif int(s1[i]) + int(s2[i]) == 1:s += "1"for i in range(len(s)):a = (a + int(s[i])) * 2print(int(a/2))