CCC '14 J3 - Double Dice

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Canadian Computing Competition: 2014 Stage 1, Junior #3

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.

Input Specification

The first line of input contains the integer n (1 \le n \le 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).

Output Specification

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.

Sample Input

4
5 6
6 6
4 3
5 2

Output for Sample Input

94
91

Explanation of Output for Sample Input

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.


Comments


  • -4
    jerry0101  commented on Nov. 14, 2019, 12:23 a.m. edited

    hi


  • -8
    dj_skxllz  commented on Nov. 4, 2017, 2:52 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


    • -8
      kipply  commented on Nov. 4, 2017, 2:58 p.m.

      This comment is hidden due to too much negative feedback. Click here to view it.


  • 2
    Roronoa_Zoro1540  commented on July 26, 2017, 4:56 p.m.

    Why'd I only get 1 point for this even though I got it on the first try?


    • 1
      wleung_bvg  commented on July 26, 2017, 11:26 p.m.

      Do you mean your total points? Only a certain percentage of points from a question contribute to your total points. Read this for more information on how it works: https://dmoj.ca/post/103-point-system-rework.


    • -8
      Pleedoh  commented on July 26, 2017, 10:08 p.m.

      This comment is hidden due to too much negative feedback. Click here to view it.


  • -2
    TheRefep  commented on Nov. 1, 2015, 2:02 p.m.

    Getting exactly the same response as the input and output, syntax exactly the same and everything, but still being put down as wrong?