#P11033. 【MX-X3-T0】「RiOI-4」宾果游戏

【MX-X3-T0】「RiOI-4」宾果游戏

Background

Original problem link: https://oier.team/problems/X3A.


The Fifth City. The Fifth Sound.

In a world where “five” seems to be everywhere.

If we can once again connect the five people, whose timelines are in chaos, into one line—

Then it will be a ray of sunlight, a way to lead ourselves out of the darkness.

(Image from Delusion: Deliver Me, please contact for removal if it infringes.)

Problem Description

There is a 55 by 55 board. Each of the 2525 cells may or may not contain a piece.

There are 1212 lines as shown on the left of the figure below. We call a board Bingo if and only if at least one line has a piece in every cell on that line. Determine whether the given board is Bingo. Some examples are shown on the right of the figure below. (Dark means there is a piece, light means there is no piece.)

You can go to this link to test different cases by yourself.

Input Format

There are 55 lines, each with 55 numbers. If there is a piece at row ii, column jj, then the jj-th number on line ii is 11; otherwise it is 00.

Output Format

If there is at least one line containing 55 pieces, output Yes; otherwise output No.

1 1 0 1 1
1 1 0 1 1
0 0 0 0 0
1 1 0 1 1
1 1 0 1 1
No
1 1 1 1 0
1 1 1 0 1
1 1 0 1 1
1 0 1 1 1
0 1 1 1 1
No
1 1 1 1 1
0 1 0 1 1
1 0 1 0 1
0 1 0 1 1
1 0 1 0 1
Yes

Hint

Sample Explanation #1

The board in this sample is the one at the top-left in the figure, and it is not Bingo.

Sample Explanation #3

The board in this sample is the one at the bottom-left in the figure, and it is Bingo.

Constraints

For 100%100\% of the testdata, all input numbers are guaranteed to be 00 or 11.

Translated by ChatGPT 5