QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 256 MB 満点: 100

#22751. Saldos bancarios

統計

Alice, Betsy, Corinne y Debra abren cuentas. Banco lleva registro central de depósitos (dinero dentro) y retiros (fuera). Son responsables y nunca retiran más de lo que tienen.

Dado registro (formato abajo), imprime saldos al terminar. Inicial 0 cada una, todo cabe en enteros de 32 bits.

Entrada

  • Línea 1: entero $N$, transacciones.

  • Líneas $2$ a $N+1$: transacción dos campos, nombre y número; positivo depósito, negativo retiro.

Salida

  • Líneas $1..4$: nombre y saldo, orden alfabético.

Ejemplos

Entrada 1

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

Salida 1

Alice 90
Betsy 100
Corinne 100
Debra 10

Nota

Detalles de entrada

Alice deposita 100, Corrinne también, Betsy 200. Alice retira 10, Debra deposita 10, Betsy retira 100. Solo nombres 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.