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

24777번 - Set! 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB74504666.667%

문제

Set is a card game designed by Marsha Falco in 1974 which is marketed by Set Enterprises, Inc. It also appears in syndicated form on the website of the New York Times. The player is shown 12 cards (see illustration), each of which contains 1, 2, or 3 symbols. The symbols are either diamonds, squiggles, or ovals. Symbols are drawn using either a solid, striped, or open fill style. Each symbol's color is either red, green, or purple. On a given card, all symbols are of the same type, same color, and have the same fill style.

To make a set, you must select three cards for which all 4 characteristics are either the same or pairwise different. For instance, 3 cards where the first shows 2 striped red ovals, the second shows 3 striped green squiggles, and the third shows 1 striped purple diamond form a set. They show 2, 3, and 1 symbols (each has a different number); they show ovals, squiggles, and diamonds (each shows a different shape); they use colors red, green, and purple (3 different colors); and lastly, they all share the same fill style: striped.

Write a program that finds all sets for 12 provided cards!

입력

The input to your program will consist of 4 lines, each containing 3 strings representing 3 cards, each is of the form ABCD where

  • A is {1, 2, 3}, corresponding to the number of symbols.
  • B is {D, S, O}, corresponding to diamonds (D), squiggles (S), and ovals (O).
  • C is {S, T, O}, corresponding to solid (S), striped (T), and open (O) fill styles.
  • D is {R, G, P}, corresponding to red (R), green (G), and purple (P). \end{itemize}

Think of the cards as being arranged in the input as follows:

+----------+
| 1 2 3 |
| 4 5 6 |
| 7 8 9 |
| 10 11 12 |
+----------+

출력

Output all sets you can find, one per line. For each set, output the numbers of the card in the set in sorted order. The sets should be listed in sorted order using the number of their first card, breaking ties using the numbers of the second and third card in the set.

If no sets can be formed, output "no sets". (Do not include any punctuation.)

The sample input/output corresponds to the illustration.

제한

예제 입력 1

3DTG 3DOP 2DSG
1SOP 1DTG 2OTR
3DOR 3STG 2DSP
3SSP 3OTG 1DTP

예제 출력 1

1 8 11
2 9 12
3 7 12
5 7 9
6 8 12
7 10 11

힌트

출처

School > Virginia Tech High School Programming Contest > 2015 Virginia Tech High School Programming Contest C번

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

출처

대학교 대회

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

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