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

34419번 - Tic-Tac-Toe Solver 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB46353175.610%

문제

After years of planning, you're finally ready to host the Tic-Tac-Toe world championships. Everything had been going great until you made a terrible discovery: the judges, who determine which player has won the game, have been taking bribes! There's not enough time to train new ones, so you opt for a backup plan: you'll create a piece of code that analyzes the board and tells the players if anyone has won.

A Tic-Tac-Toe board looks like the following. Every square can be empty, filled with an X, or filled with a O (capital letter 'o').

Player X has won if they have three X's in a row. Player O wins if they can do the same with the O's. A row can be horizontal, vertical, or diagonal.

Can you write the new judging code and salvage the competition?

입력

The input consists of three lines each with 3ドル$ characters. Each line represents a row on the board. Each character in a line represents a column. This means you have 3ドル$ rows and 3ドル$ columns just like a normal Tic-Tac-Toe board.

Each square in the board contains either an X, O (that's a capital letter, not a number), or E. X and O represent markings made by the players while E represents an empty square.

출력

If player X has won, you should print out the character X. If player O has won, you should print out the character O. If neither player has won, you should print out the character N.

제한

예제 입력 1

XEO
EXO
EOX

예제 출력 1

X

예제 입력 2

OXO
OXX
XOX

예제 출력 2

N

예제 입력 3

XXE
EEX
OOO

예제 출력 3

O

노트

출처

School > CS@Mines > CS@Mines HSPC 2021 I번

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

출처

대학교 대회

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

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