a079: Tic-Tac-Toe 圈圈叉叉
標籤 :
通過比率 : 67% (2 人 / 3 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2020-04-16 12:04

內容

The Tic-Tac-Toe game is a childhood memory of everyone. Even after people grow up, they still like to play it when they are bored! When you are alone, can you let the computer play with you?

OX 遊戲是大家小時候的童年記憶,甚至在長大後,無聊時還是會玩一下呢 ! 但當你一個人時,是否也能讓電腦跟你玩呢 ?

輸入說明

The first line of input contains an integer n (1 <= n <= 10), which is the number of the test sets. Each test set includes a 2-dimensional matrix of size 3 * 3. Element 0 means ‘O’ and 1 for ‘X.’ Please determine if there is a winner in the pattern.

Note: Any two matrix elements are separated by a space.

 

第一行輸入一個整數n(1 <= n <= 10),表示有n組測資。每組測資包含一個 3*3 的 2 維矩陣。矩陣的每一個單項0 代表 ‘O’ , 1 代表 ‘X’ 。註:每行的數字之間均以一個空格隔開。

輸出說明

If there is a winner in the test set, output 'True'; otherwise output 'False.'

Note: The result of each test data is printed in one line, and the end of the output needs a newline character.

 

輸出這場 OX 遊戲是否有勝負之分,有則輸出True,否則輸出False。註:每筆測資的結果列印於一行,輸出結尾需換行。

範例輸入
2
1 0 1 
0 1 1
0 0 0
0 1 0
1 0 0
1 0 1
範例輸出
True
False
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (100%): 1.0s , <1K
提示 :
標籤:
出處:
[編輯 :
shengZJ (shengZJ)
]


編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」