QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 256 MB 총점: 100

#22751. Số dư ngân hàng

통계

Alice, Betsy, Corinne, Debra mở tài khoản. Ngân hàng ghi tập trung gửi (tiền vào) và rút (tiền ra). Họ có trách nhiệm, không rút quá tiền có.

Cho sổ (dạng dưới), in số dư sau mọi giao dịch. Đầu mỗi 0, mọi số vừa số nguyên 32 bit.

Dữ liệu vào

  • Dòng 1: số nguyên $N$, giao dịch.

  • Dòng $2$ tới $N+1$: hai trường tên và số; dương gửi, âm rút.

Dữ liệu ra

  • Dòng $1..4$: tên và số dư, thứ tự chữ cái.

Ví dụ

Dữ liệu vào 1

6
Alice +100
Corinne +100
Betsy +200
Alice -10
Debra +10
Betsy -100

Dữ liệu ra 1

Alice 90
Betsy 100
Corinne 100
Debra 10

Ghi chú

Chi tiết đầu vào

Alice gửi 100, Corrinne cũng vậy, Betsy 200. Alice rút 10, Debra gửi 10, Betsy rút 100. Chỉ tên Alice, Betsy, Corinne, Debra.

Tác giả: Rob Kolstad, 2004

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.