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

11343번 - Crushing Confections 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB135877765.254%

문제

A popular app has players line up a set of three candies of the same color in a row in order to remove them from the screen and continue playing. The candies come in six colors: blue, yellow, green, orange, purple, and red. They are arranged in a two-dimensional grid with horizontal rows and vertical columns. Once a player has moved candies to complete and remove a set of candies, the game must automatically find and remove any remaining sets of three candies of the same color in a row.

Your program must find and display the location of a valid set of three candies of the same color in a row (or column) or display “no set found.” If there is more than one valid set, your program may display the location of any one of the valid sets. The rows are numbered from 1 starting at the top. The columns are numbered from 1 starting at the left.

입력

The input will start with a number representing the number of test cases. Each test case consists of one line containing two integers representing the number of rows and columns of the grid followed by a grid representing the colors of the candies.

The dimensions of the board will be at most 100 by 100.

출력

Your output should be three ordered pairs of integers representing row numbers and column numbers, respectively, of a valid set if there is a valid set found. If there is no valid set found, your output should consist of the message “no set found.”

제한

예제 입력 1

3
4 7
R R Y B O G P
P G R Y O G B
B G R Y O B Y
P R G B Y B R
5 5
P G O B R
G O B R P
O B R P G
B R P G O
R P G O B
6 4
R O B Y
Y O B R
O B R Y
G B G B
R Y Y Y
B G O R

예제 출력 1

1 5 2 5 3 5
no set found
5 2 5 3 5 4

힌트

출처

School > Cornell University High School Programming Contest > 2nd Annual Cornell University High School Programming Contest 4번

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

출처

대학교 대회

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

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