@@ -0,0 +1,847 @@
+// http://codeforces.com/problemset/problem/570/A%0A%0Aimport java.util.Scanner;%0A%0Apublic class Solution %7B%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner read = new Scanner(System.in);%0A%0A%09%09int n = read.nextInt();%0A%09%09int m = read.nextInt();%0A%09%09%0A%09%09int%5B%5D wins = new int%5Bn%5D;%0A%09%09%0A%09%09int%5B%5D%5B%5D a = new int%5Bm%5D%5Bn%5D;%0A%09%09for (int i = 0; i %3C m; ++i) %7B%0A%09%09%09int maxVotes = 0;%0A%09%09%09int winnerIndex = 0;%0A%09%09%09for (int j = 0; j %3C n; ++j) %7B%0A%09%09%09%09a%5Bi%5D%5Bj%5D = read.nextInt();%0A%09%09%09%09if (a%5Bi%5D%5Bj%5D %3E maxVotes) %7B%0A%09%09%09%09%09maxVotes = a%5Bi%5D%5Bj%5D;%0A%09%09%09%09%09winnerIndex = j;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09wins%5BwinnerIndex%5D++;%0A%09%09%7D%0A%09%09%0A%09%09int maxWins = 0;%0A%09%09int maxWinsIndex = 0;%0A%09%09for (int i = 0; i %3C n; ++i) %7B%0A%09%09%09if (wins%5Bi%5D %3E maxWins) %7B%0A%09%09%09%09maxWins = wins%5Bi%5D;%0A%09%09%09%09maxWinsIndex = i;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09System.out.println(maxWinsIndex + 1); // candidates are numbered from 1 to 'n'%0A%09%09%0A%09%09// Close scanner%0A%09%09read.close();%0A%09%7D%0A%09%0A%7D%0A

Create Elections.java