Kajak
의견: 0
Mirko and Slavko are sports commentators on a local kayaking competition. They have a live satellite feed of the entire track. Since there are too many teams for our dynamic duo to follow, they asked you to help them. They would like you to write a program that will display current standings team-by-team.
The satellite feed is encoded as a table of \(R\) rows, \(C\) characters each. The first character in each row is the starting line, encoded by the character S. The last character in each row is the finishing line, encoded by F. There are exactly nine kayaks on the image. Each kayak is marked by its number, and each spans exactly three consecutive columns. Water is marked by ..
Teams are ranked by their distance to the finish line. Smaller is better. If two teams are at the same distance, they share their place.
The first line of input contains two integers \(R\) and \(C\) (\(10 \le R, C \le 50\)), the number of rows and columns of the encoded satellite image.
Each of the following \(R\) lines contains exactly \(C\) characters ., S, F and digits 1 to 9. Each row will contain at most one kayak. Each image contains all \(9\) kayaks.
Output nine lines, one for each kayak. The \(i\)-th line should contain the current rank of the \(i\)-th team.
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Test 1 | 10점 | None |
Test 2 | 10점 | None |
Test 3 | 10점 | None |
Test 4 | 10점 | None |
Test 5 | 10점 | None |
Test 6 | 10점 | None |
Test 7 | 10점 | None |
Test 8 | 10점 | None |
Test 9 | 10점 | None |
Test 10 | 10점 | None |
10 10
S.....111F
S....222.F
S...333..F
S..444...F
S.555....F
S666.....F
S.777....F
S..888...F
S...999..F
S........F1
2
3
4
5
6
5
4
310 15
S..........222F
S.....111.....F
S...333.......F
S...555.......F
S.......444...F
S.............F
S......777....F
S..888........F
S........999..F
S...666.......F5
1
6
3
6
6
4
7
2평가 및 의견
Kajak
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Kajak