QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 256 MB Toplam puan: 100

#22751. Kontostände

İstatistikler

Alice, Betsy, Corinne und Debra eröffnen Konten. Die Bank führt ein zentrales Buch für Einzahlungen (hinein) und Abhebungen (heraus). Sie sind verantwortungsvoll und heben nie mehr ab als vorhanden.

Aus dem Buch (Format unten) gib Endstände nach allen Transaktionen aus. Anfang jeweils 0, alle Zahlen passen in 32-Bit-Ganzzahlen.

Eingabe

  • Zeile 1: ganze Zahl $N$, Transaktionen.

  • Zeilen $2$ bis $N+1$: Transaktion mit Name und Zahl; positiv Einzahlung, negativ Abhebung.

Ausgabe

  • Zeilen $1..4$: Name und Stand in alphabetischer Reihenfolge.

Beispiele

Eingabe 1

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

Ausgabe 1

Alice 90
Betsy 100
Corinne 100
Debra 10

Hinweis

Eingabedetails

Alice zahlt 100 ein, Corrinne auch, Betsy 200. Alice hebt 10 ab, Debra zahlt 10 ein, Betsy hebt 100 ab. Nur Namen Alice, Betsy, Corinne, Debra.

Autor: 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.