Codeforces #68 A "Room Leader"

問題:http://codeforces.com/contest/74/problem/A

部屋の人数とその参加者の名前,Hack回数,被Hack回数,また,ABCDEそれぞれの問題の解答における点数のリストが与えられる.部屋内における最高点を得た参加者の名前を求める.

単にそれぞれの得点を計算した.あとHackとして,最高点は負の可能性もあるところから最大を求める際の初期値を0にしてる人を狙った.

コード

import java.util.*;

public class A {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		List<String> names = new ArrayList<String>();
		List<Integer> scores = new ArrayList<Integer>();
		int max = Integer.MIN_VALUE;
		for(int n = s.nextInt(); n-->0;){
			names.add(s.next());
			int r = s.nextInt() * 100 - s.nextInt() * 50;
			for(int i = 0; i < 5; ++i){
				r += s.nextInt();
			}
			scores.add(r);
			max = Math.max(max, r);
		}
		System.out.println(names.get(scores.indexOf(max)));
	}
}