Created
April 6, 2017 13:28
-
-
Save abhinavkorpal/b41e6fdb4f9251d046a786006f25be90 to your computer and use it in GitHub Desktop.
collections.Counter()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| n = input() | |
| boots = map(int, raw_input().split()) | |
| orders = [map(int, raw_input().split()) for _ in range(input())] | |
| result = 0 | |
| for i in orders: | |
| if i[0] in boots: | |
| result += i[1] | |
| boots.remove(i[0]) | |
| print result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment