제출 #222400

#제출 시각아이디문제언어결과실행 시간메모리
222400shenxyACM (COCI19_acm)C++11
컴파일 에러
0 ms0 KiB
public class acm { private static class IntPair implements Comparable<IntPair> { public int a, b; public IntPair(int a, int b) { this.a = a; this.b = b; } public int compareTo(IntPair i) { if (i.a != this.a) return this.a - i.a; return i.b - this.b; } } private static class Ranking implements Comparable<Ranking> { public String team; public IntPair score; public Ranking(String team, IntPair score) { this.team = team; this.score = score; } public int compareTo(Ranking i) { if (this.score.compareTo(i.score) != 0) return this.score.compareTo(i.score); return i.team.compareTo(this.team); } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(), M = sc.nextInt(); ArrayList<Ranking> arr = new ArrayList<Ranking>(); for (int i = 0; i < N; ++i) { String team = sc.next(); IntPair score = new IntPair(0, 0); for (int j = 0; j < M; ++j) { String res = sc.next(); if (res.charAt(0) != '-') { ++score.a; int time = 0; time += 1200 * (res.charAt(1) - '0'); time += 3600 * Integer.parseInt(res.substring(3, 5)) + 60 * Integer.parseInt(res.substring(6, 8)) + Integer.parseInt(res.substring(9, 11)); score.b += time; } } if (!team.equals("NijeZivotJedanACM")) arr.add(new Ranking(team, score)); } Collections.sort(arr); Ranking nijeRanking; String team = sc.next(); IntPair score = new IntPair(0, 0); for (int j = 0; j < M; ++j) { String res = sc.next(); if (res.charAt(0) != '-') { ++score.a; int time = 0; time += 1200 * (res.charAt(1) - '0'); time += 3600 * Integer.parseInt(res.substring(3, 5)) + 60 * Integer.parseInt(res.substring(6, 8)) + Integer.parseInt(res.substring(9, 11)); score.b += time; } } nijeRanking = new Ranking(team, score); for (int i = 1; i <= arr.size(); ++i) { if (nijeRanking.compareTo(arr.get(arr.size() - i)) > 0) { System.out.println(i); return; } } System.out.println(N); return; } }

컴파일 시 표준 에러 (stderr) 메시지

acm.cpp:1:1: error: expected unqualified-id before 'public'
 public class acm {
 ^~~~~~