Felix Halim .NET  
University Experience
IOI 2002 Yong In, Korea
ACM ICPC Regional Manila 2003
ACM ICPC Regional Manila 2004
ACM ICPC Regional Manila 2005
ACM ICPC Regional Kaohsiung 2006
ACM ICPC Regional Singapore 2007
ACM ICPC Regional Jakarta 2008 (ext)
ACM ICPC Regional Jakarta 2009 (ext)
ACM ICPC Regional Jakarta 2010
ACM ICPC Regional Jakarta 2012  Problem H
ACM ICPC Regional Jakarta 2013  Problem J (new!)
ACM ICPC World Final Tokyo 2007
Google India Code Jam 2005
Google India Code Jam 2006
Indonesia National Contest 2007
Indonesia National Contest 2008
Indonesia National Contest 2010
Facebook Hacker Cup 2011


ACM/ICPC Indonesia National Contest 2007  QualificationProblem AThe Chosen Sub MatrixTime Limit: 1sFrom a given N x N matrix, you should find an M x M sub matrix which has the least distinct element in it. If there are more than one sub matrixes which have the same number of distinct elements then compare each element in descending order and choose one that has the first highest element. If all of distinct elements of all sub matrixes are the same, chose one with the least row index, and then the least column index. The matrix index starts at 1. For example, given a 4x4 matrix:
Then, the possible sub matrixes of 3x3 are:
Sub matrix S_{2} has 2 distinct elements: 9 and 2; Sub matrix S_{3} has 4 distinct elements: 9, 5, 3, and 2; Sub matrix S_{4} has 3 distinct elements: 9, 5, and 2. Sub matrixes are ranked using the rules above and give result as S_{1}, S_{2}, S_{4}, and then S_{3}. Which means the chosen sub matrix is S_{1}. Input SpecificationThe first line of each case contains two integers, N (1<=N<=10) the size of matrix, and M (1<=M<=N) the size of sub matrix to be chosen. In the next N lines, each contains N integers (each separated by a space) that represent the matrix. Each element in the matrix should be between 0 and 9 inclusively.Output SpecificationFor each case you should output in a single line, the topleft index (row and column, separated by a single space) of the chosen sub matrix.Sample Input4 3 3 9 9 9 3 9 9 2 3 9 9 2 2 5 5 2 10 2 1 5 7 8 2 3 3 3 1 7 2 2 3 6 3 7 3 2 3 1 5 9 3 5 7 0 4 6 9 1 1 0 3 4 2 6 4 3 9 0 7 4 9 9 5 4 6 2 1 5 5 6 9 9 6 6 3 8 0 8 4 3 3 5 2 1 7 6 4 1 6 5 9 5 0 3 1 8 8 6 2 2 2 8 0 1 3 5 9 0 3 6 4 2 3 3 0 2 0 0 Sample Output1 1 5 3 Problem Setter: Bong Win Ce Kembali ke pembahasan soal ini Lihat problem lain: 