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

Kolo

Gold V 골드 V
난이도
1s
시간 제한
32MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Mirko has recently bought a wheel of fortune. He wrote an uppercase letter of the English alphabet onto each wedge. No letter appears twice on the wheel, and the wheel spins in the clockwise direction. There is a pointer that stays in the same place while the wheel is spinning. When we spin the wheel, the letter to which the pointer is pointing changes accordingly.

Mirko spun the wheel \(K\) times in a row, and each time he wrote down how many times the pointed letter changed, and what letter was pointed to at the end of that spin.

Slavko found that paper, and would like to know what letters Mirko wrote onto the wedges of the wheel. Help him determine this, if the total number of wedges is known.

제약
입력 형식

The first line of input contains integers \(N\) (\(2 \le N \le 25\)), the number of wedges on the wheel, and \(K\) (\(1 \le K \le 100\)), the number of spins.

The following \(K\) lines contain the descriptions Mirko wrote down for each spin, in order. Each line contains an integer \(S\) (\(1 \le S \le 100\)), the number of times the pointed letter changed during that spin, and an uppercase letter at which the pointer stopped.

출력 형식

If there is no wheel that meets the requirements described, output ‘!’.
Otherwise, output sequence of letters written onto the wheel, starting from the pointed letter at the end
of the last spin and proceeding clockwise. If some letter can’t be determined, output ‘?’ instead.
\(7^{th}\) round, April \(9^{th}\), 2011

서브태스크
서브태스크점수설명

Test 1

7점

None

Test 2

7점

None

Test 3

7점

None

Test 4

7점

None

Test 5

6점

None

Test 6

6점

None

Test 7

6점

None

Test 8

6점

None

Test 9

6점

None

Test 10

6점

None

Test 11

6점

None

Test 12

6점

None

Test 13

6점

None

Test 14

6점

None

Test 15

6점

None

Test 16

6점

None

예제 1
입력
3 3
1 A
2 B
3 C
출력
!
예제 2
입력
5 6
1 A
2 B
5 B
1 C
2 A
2 B
출력
B?A?C
예제 3
입력
8 8
4 V
3 I
7 T
7 A
6 R
5 N
1 O
9 H
출력
HONITAVR
문제 정보

riseoj 작성

출처 COCI 2010/2011 Contest 7

평가 및 의견

Kolo

개요
출제자 난이도 Gold V 골드 V 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Kolo

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