Logo
(追記) (追記ここまで)

21022번 - Three Points for a Win 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB44540536692.191%

문제

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}.

  • At the first match, BINUS’ team wins by 3 vs 1.
  • At the second match, BINUS’ team loses by 0 vs 1.
  • The third match is a draw (both have the same score of 2).
  • At the fourth match, BINUS’ team wins by 4 vs 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.

제한

예제 입력 1

4
3 0 2 4
1 1 2 3

예제 출력 1

7

This is the example from the problem description.

예제 입력 2

2
3 3
4 3

예제 출력 2

1

BINUS loses the first match and has a draw on the second match, thus, the total point is 0 + 1 = 1.

예제 입력 3

6
5 5 5 5 5 5
1 6 5 3 7 0

예제 출력 3

10

힌트

출처

ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2019 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /