Largest Square Submatrix of all 1's C#_user

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 listAug 16, 2026 20:03Victor MerckléVictor MerckléScore: 916,615Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 16, 2026 20:07916,290374,695,319366,516,00002,125,824stderr
2Aug 16, 2026 20:07916,487375,598,588365,573,0001,022,0002,125,824stderr
3Aug 16, 2026 20:07916,487375,300,637365,581,0001,014,0002,125,824stderr
4Aug 16, 2026 20:07916,575374,986,341365,600,0001,030,0002,125,824stderr
5Aug 16, 2026 20:07916,615375,872,220365,611,0001,035,0002,125,824stderr
6Aug 16, 2026 20:07916,627375,778,300365,636,0001,015,0002,125,824stderr
7Aug 16, 2026 20:07916,725374,928,102365,688,0001,002,0002,125,824stderr
8Aug 16, 2026 20:07916,840375,865,711365,715,0001,021,0002,125,824stderr
9Aug 16, 2026 20:07917,415376,383,608365,747,0001,219,0002,125,824stderr