시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 201 | 185 | 161 | 94.706% |
Three points for a win is a common point system used in competitions such as football (soccer) leagues or group tournaments. In this system, a team is awarded 3 points if they win a match, 1 point for a draw, and 0 points if they lose. Finally, the team with the most points wins the league.
Supposed BINUS’ football team joins a league and has played N matches. At the ith match, BINUS’ team scores Ai vs Bi against their opponent. If Ai > Bi, then BINUS’ team wins the ith match; if Ai < Bi, then BINUS’ team loses the match; otherwise, if Ai = Bi, then it’s a draw. Given the score of each match, your task is to determine the total points accumulated by BINUS’ team.
For example, let N = 4 where A1..4 = {3, 0, 2, 4} and B1..4 = {1, 1, 2, 3}.
Therefore, the total points accumulated by BINUS’ team in this example is: 3 + 0 + 1 + 3 = 7.
Input begins with a line containing an integer: N (1 ≤ N ≤ 100) representing the number of matches. The next line contains N integers: Ai (0 ≤ Ai ≤ 10) representing the score of BINUS’ team. The next line contains N integers: Bi (0 ≤ Bi ≤ 10) representing the score of BINUS’ opponent team.
Output in a line an integer representing the total points accumulated by BINUS’ team.
4 3 0 2 4 1 1 2 3
7
This is the example from the problem description.
2 3 3 4 3
1
BINUS loses the first match and has a draw on the second match, thus, the total point is 0 + 1 = 1.
6 5 5 5 5 5 5 1 6 5 3 7 0
10
ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2019 A번