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

21197번 - Stopwatch 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB51543438787.162%

문제

Robin just received a stopwatch from her grandfather. Robin's stopwatch has a single button. Pressing the button alternates between stopping and starting the stopwatch's timer. When the timer is on, the displayed time increases by 1 every second.

Initially the stopwatch is stopped and the timer reads 0 seconds. Given a sequence of times that the stopwatch button is pressed, determine what the stopwatch's timer displays.

입력

The first line of input contains a single integer $N$ (1ドル \leq N \leq 1,000円$), which is the number of times the stopwatch was pressed.

The next $N$ lines describe the times the stopwatch's button was pressed in increasing order. Each line contains a single integer $t$ (0ドル \leq t \leq 10^6$), which is the time the button was pressed. No two button presses happen on the same second.

출력

Display still running if the stopwatch's timer is still running after all button presses were made. Otherwise display the number of seconds displayed on the stopwatch's timer.

제한

예제 입력 1

2
7
11

예제 출력 1

4

예제 입력 2

5
2
5
9
10
17

예제 출력 2

still running

예제 입력 3

4
0
2
104
117

예제 출력 3

15

힌트

출처

ICPC > Regionals > North America > Rocky Mountain Regional > 2020 Rocky Mountain Regional Contest A번

  • 문제를 만든 사람: Zachary Friggstad
(追記) (追記ここまで)

출처

대학교 대회

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

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