Largest Square Submatrix of all 1's NoSIMD_C#

Find the largest square submatrix consisting entirely of 1s as fast as possible.

Input

A 10,000 x 10,000 matrix of uint8 values (0 or 1) on STDIN.

0, 1, 0, 1, 1
0, 1, 1, 1, 1
0, 0, 1, 0, 0
1, 0, 1, 1, 0

Output

Print the side length of the largest all-ones square submatrix to STDOUT. The answer is guaranteed to be greater than 1.

For the example above, the output is:

2
Back to listJun 12, 2025 21:52Franek KortaFranek KortaScore: 1,120,815Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 12, 2025 21:521,116,365471,331,622445,548,000998,0002,420,736
2Jun 12, 2025 21:521,117,605468,638,104444,042,0003,000,0002,531,328
3Jun 12, 2025 21:511,117,988466,010,665446,195,0001,000,0002,269,184
4Jun 12, 2025 21:511,118,075472,189,439446,230,0001,000,0002,269,184
5Jun 12, 2025 21:521,118,513479,347,004446,407,000998,0002,269,184
6Jun 12, 2025 21:521,118,795472,405,101445,521,0001,997,0002,531,328
7Jun 12, 2025 21:511,118,930469,961,181445,574,0001,998,0002,428,928
8Jun 12, 2025 21:511,120,630475,193,379447,252,0001,000,0002,269,184
9Jun 12, 2025 21:511,120,725476,515,931448,290,00002,531,328
10Jun 12, 2025 21:521,120,815475,262,730448,326,00002,531,328
11Jun 12, 2025 21:521,121,438471,579,315447,576,000999,0002,428,928
12Jun 12, 2025 21:521,122,118476,604,097447,848,000999,0002,531,328
13Jun 12, 2025 21:521,122,280469,400,501447,913,000999,0002,531,328
14Jun 12, 2025 21:511,122,295474,236,141446,919,0001,999,0002,424,832
15Jun 12, 2025 21:511,122,923471,661,630449,169,00002,531,328
16Jun 12, 2025 21:511,122,975476,404,942449,190,00002,428,928
17Jun 12, 2025 21:511,122,993470,594,285449,197,00002,428,928
18Jun 12, 2025 21:521,123,393470,411,017449,357,00002,424,832