DMOPC '16 Contest 4 P2 - Systests

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

Having finished her homework, Molly decides to write the DMOPC. However, as a kitten, she can't actually code, and decides to asks you to compete on her behalf. As you (probably) know, the DMOPC is systested, usually with batches. Failing any test case in a batch results in a score of 0 for that batch.

Being the great hacker programmer that you are, you know precisely which cases belong to which batch, and how your program will do on the cases. All that remains is to see how many points you can get…

Input Specification

Line 1: An integer, B, the number of batched cases that follow.
Line 2 \dots B + 1: 3 space separated integers, f_i, e_i, and p_i, indicating that the i^{th} batch starts on test case f_i, ends on case e_i, and is worth p_i points.
Line B + 2: An integer, F, the number of test cases the program fails.
Lines B + 3 \dots B + F + 2: An integer, t_i, indicating the program fails the t_i^{th} test case.

Output Specification

A single integer, the number of points the program can get.

Constraints

For all cases, p_i (0 \le p_i \le 10^4).

Subtask Points B f_i, e_i F t_i
1 5 1 \le B \le 10^3 1 \le f_i \le e_i \le 10^3 F = 0 DNE
2 5 1 \le B \le 10^3 1 \le f_i \le e_i \le 10^3 1 \le F \le 10^3 1 \le t_i \le 10^3
3 30 1 \le B \le 10^5 1 \le f_i \le e_i \le 10^5 1 \le F \le 10^3 1 \le t_i \le 10^5
4 60 1 \le B \le 10^5 1 \le f_i \le e_i \le 10^9 1 \le F \le 10^5 1 \le t_i \le 10^9

Sample Input

3
1 5 100
20 21 10
1 18 1
2
2
5

Sample Output

10

Explanation for Sample Output

By failing test cases 2 and 5, the program fails batches 1 and 3, and only passes batch 2, giving it a total of 10 points.


Comments


  • 1
    tankturtle  commented on Feb. 15, 2017, 11:46 a.m.

    f and e and be zero. I hate you guys