Help in my submission.

Revision en2, by adityachad, 2024-06-06 07:46:15

I was solving the E problem from this Codeforces Round 950 (Div. 3) named E.Permutation of Rows and Columns, and came up with the following approach:-

Since the shifting is by rows and columns only, that means the elements that were in the same column will remain in the same column, and all elements in the same row will stay in the same, ordering within might be different in both cases but the composition will always be same so I implemented this by the following.

I took each row of the given original matrix sorted that and appended it to a vectorA, similarly took each column of that original matrix sorted that, and appended it to the same vectorA, at the end I sorted this vectorA also. Did the exact thing for the matrix in which to achieve, took rows, sorted them appended them, same for columns into a vectorB In the end, I just compared both vectorA and vectorB and gave the verdict that if same then "YES" else "NO". My Submission

Can anyone tell where I am wrong, In thinking about the approach or implementation or if I just totally misunderstood the problem?

Thanks for helping :) !

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English adityachad 2024-06-06 07:46:15 61
en1 English adityachad 2024-06-06 07:45:34 1277 Initial revision (published)