RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
문제 R03686

J3. Double Dice

설명

Antonia and David are playing a game.

Each player starts with 100 points. The game uses standard six-sided dice and is played in rounds. During
one round, each player rolls one die. The player with the lower roll
loses the number of points shown on the higher die. If both players roll
the same number, no points are lost by either player.

Write a program to determine the final scores.

제약
입력 형식

The first line of input contains the integer \(n~(1 \leq n \leq 15)\), which is the number of rounds that will be played. On
each of the next \(n\) lines, will be
two integers: the roll of Antonia for that round, followed by a space,
followed by the roll of David for that round. Each roll will be an
integer between 1 and 6 (inclusive).

출력 형식

The output will consist of two lines. On the first line, output the
number of points that Antonia has after all rounds have been played. On
the second line, output the number of points that David has after all
rounds have been played.

예제 1
입력
4
5 6
6 6
4 3
5 2
출력
94
91
설명

After the first round, David wins, so Antonia loses 6 points. After
the second round, there is a tie and no points are lost. After the third
round, Antonia wins, so David loses 4 points. After the fourth round,
Antonia wins, so David loses 5 points. In total, Antonia has lost 6
points and David has lost 9 points.

문제 정보

생성자가 기록되지 않았습니다.

출처 CCC 2014 Junior

평가 및 의견

J3. Double Dice

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

J3. Double Dice

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8