Submit | All submissions | Best solutions | Back to list |
EICARDSYS - Member card management |
After demonstrating the function of calculating the discount (https://www.spoj.com/EIUDISC2/problems/EIMEMCARD/ for a member. You are requested to complete the discount calculation program for all customers of the company. The company's data is a list of transactions, including customer id and product price customers bought. Transactions have been arranged in chronological order.
Input
The first line contains the number n, which is the number of transactions (n ≤ 105)
The next n lines contain the transaction data, including a 10-character string that is the customer code, and an integer that is the price of the product the customer purchases.
The first line contains the number n, which is the number of transactions (n ≤ 105)
The next n lines contain the transaction data, including a 10-character string that is the customer id, and an integer that is the price of the product the customer purchased.
Output
Print out the total amount of discount money.
Example
Input:
5
KH00000001 3000000
KH00000002 12000000
KH00000001 30000000
KH00000002 8000000
KH00000002 80000000
Output:
3160000
Added by: | Ha Minh Ngoc |
Date: | 2018-05-02 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |