結果

問題 No.2086 A+B問題
ユーザー Akijin_007Akijin_007
提出日時 2022-09-30 21:38:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 71,552 KB
最終ジャッジ日時 2023-08-24 15:01:45
合計ジャッジ時間 2,969 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,416 KB
testcase_01 AC 71 ms
71,248 KB
testcase_02 AC 72 ms
71,488 KB
testcase_03 AC 71 ms
71,404 KB
testcase_04 AC 71 ms
71,424 KB
testcase_05 AC 70 ms
71,380 KB
testcase_06 AC 71 ms
71,348 KB
testcase_07 AC 70 ms
71,400 KB
testcase_08 AC 72 ms
71,508 KB
testcase_09 AC 73 ms
71,176 KB
testcase_10 AC 71 ms
71,380 KB
testcase_11 AC 72 ms
71,552 KB
testcase_12 AC 71 ms
71,432 KB
testcase_13 AC 71 ms
71,428 KB
testcase_14 AC 72 ms
71,296 KB
testcase_15 AC 73 ms
71,356 KB
testcase_16 AC 72 ms
71,428 KB
testcase_17 AC 70 ms
71,352 KB
testcase_18 AC 71 ms
71,384 KB
testcase_19 AC 73 ms
71,504 KB
testcase_20 AC 73 ms
71,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

A = input()
B = input()

la = len(A)
lb = len(B)

if la > lb:
    B = "0" * (la - lb) + B
else:
    A = "0" * (lb - la) + A

ans = []
m = len(A)
t = 0

for i in range(m):
    t, v = divmod(t + int(A[m-i-1]) + int(B[m-i-1]), 10)
    ans.append(v)

if t == 1:
    ans.append(t)

print("".join(str(_) for _ in ans[::-1]))



0