Sunday, September 28, 2014

ACM 1319. Hotel / Отель

 Suppose we have a function which takes a point and starts going into the direction of the diagonal and filling the elements on the way until it gets out of the border N. It is easy to implement, we need to take the given coordinate and add every time 1 to both of the coordinates to get to the next cell. We need to launch this function for the cells A[1][n...1] which will complete the first half and also A[2...n][1] which will complete the matrix.


       FULL SOURCE CODE

No comments:

Post a Comment