結果
問題 | No.2086 A+B問題 |
ユーザー |
|
提出日時 | 2024-07-24 20:37:01 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 480 bytes |
コンパイル時間 | 556 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 54,372 KB |
最終ジャッジ日時 | 2024-07-24 20:37:03 |
合計ジャッジ時間 | 2,462 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 1 |
ソースコード
A = input() B = input() N = max(len(A), len(B))+1 A = str(A).zfill(N) B = str(B).zfill(N) A = A[::-1] B = B[::-1] # print(A) ans = [] kuri = 0 for i in range(N): now = int(A[i]) + int(B[i]) + kuri if now >= 10: kuri = 1 else: kuri = 0 ans.append(str(now%10)) sans_ = "".join(ans) sans_ = sans_[::-1] ans = [] first = True for c in sans_: if first == True and c == '0': continue first = False ans.append(c) print("".join(ans))