포럼
문제 ICPC00308

K. km/h

설명

Many countries have a “national speed limit”: a default maximum speed that applies unless a speed limit sign explicitly sets a lower one. Such a speed limit sign shows a number and overrides the default while it is in force. By contrast, a derestriction sign shows no number at all; it cancels the previous restriction and restores the national speed limit, which is always strictly higher than any speed limit sign.

You pride yourself on being a careful and attentive motorist. Whenever you encounter a speed limit sign, you smoothly and safely adjust your vehicle's speed. Alas, despite your otherwise impeccable memory, the derestriction sign always leaves you guessing. You simply cannot remember the national speed limit – only that it was a neat multiple of ten.

As you encounter each sign – limit or derestriction – determine the fastest you can go while abiding the law, based only on what you've seen so far.

제약
입력 형식

The input consists of:
- One line with an integer \(N\) with \(1\leq N\leq 100\), the number of signs.
- \(N\) lines, one for each sign. Each line describes either a speed limit or a derestriction. A speed limit is an integer \(L\) with \(10\leq L\leq 160\), the speed limit that applies from that sign. A derestriction is the forward slash"/", reminiscent of the sign's diagonal bar. The first line contains a speed limit. There are never two consecutive derestrictions.

출력 형식

Output \(N\) integers, the maximum legal speed that can be inferred when passing the \(i\)th sign for \(1\leq i\leq N\).

예제 1
입력
8
90
85
/
119
/
85
85
/
출력
90
85
100
119
120
85
85
120
문제 정보

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

출처 ICPC NCPC 2025

평가 및 의견

K. km/h

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

Log in to rate problems.

개별 의견

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

풀이 제출

K. km/h

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