QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22751. יתרות בנק

Statistics

Alice, Betsy, Corinne ו־Debra פתחו חשבונות. הבנק רושם מרכזית הפקדות (פנימה) ומשיכות (החוצה). אחראיות, אף פעם לא מושכות יותר מהקיים.

מהרישום (פורמט בהמשך) הדפיסו יתרות אחרי כל העסקאות. התחלה 0 לכולן, כל המספרים בשלמים 32 ביט.

קלט

  • שורה 1: שלם $N$, מספר עסקאות.

  • שורות $2$ עד $N+1$: עסקה בשני שדות, שם ומספר; חיובי הפקדה, שלילי משיכה.

פלט

  • שורות $1..4$: שם ויתרה בסדר אלפביתי.

דוגמאות

קלט 1

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

פלט 1

Alice 90
Betsy 100
Corinne 100
Debra 10

הערה

פרטי קלט

Alice מפקידה 100, Corrinne גם, Betsy 200. Alice מושכת 10, Debra מפקידה 10, Betsy מושכת 100. רק Alice, Betsy, Corinne, Debra.

מחבר: 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.