When flattening a 2D array breaks your algorithm -— and yet it passes
Разница между en1 и en2, 84 символ(ов) изменены
So I did some training and did B. Fox and Cross[problem:389B] and i did it in a for me decent time as well. like 15 min. ↵
The ID is: 
[submission:393831255] ↵
with the basic idea to flat n*n matrix into a 1D array, (because 2D is scary to me idc) and then scan in row-major order to encounter the topmost cell first, then attempt to consume the five cells belonging to a cross, if i dont find the according four other cells ive found an uncommplete cross and cancel.↵
But if i have a cross at [
10,n], id have to check [21,n], [32,n], [23,n-1] and [23,n+1]. naturally [2, n+1] doesnt work and id have to return an error here. ↵
↵
~~~~~↵
↵
4↵
...#↵
..##↵
#..#↵
....↵
~~~~~↵
↵
↵
↵
But due to the flattening of the Matrix to 1D i would simply check [3,0] as id slide into the the next row, as long im not already in the last row
(i just checked for < n*n).  So my Ccode would accept the exaemplaray input even tho its pretty clearly not a cross. ↵
Now the funny thing is, my appr
aooach is so stupid that the Judge never checks such edge case and still let my code pass haha

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Venttix 2026-10-09 15:38:18 84 Tiny change: 'ecked for n*n). So' -> 'ecked for < n*n). So' (published)
en1 Английский Venttix 2026-10-09 15:28:13 1074 Initial revision (saved to drafts)