제출 #1127985

#제출 시각아이디문제언어결과실행 시간메모리
1127985secretwood01Exhibition (JOI19_ho_t2)Java
컴파일 에러
0 ms0 KiB
import java.util.*; import java.io.*; class Pic implements Comparable<Pic> { int s, v; public Pic(int s, int v) { this.s = s; this.v = v; } public int compareTo(Pic p) { if (v!=p.v) return Integer.compare(p.v, v); else return Integer.compare(p.s, s); } } public class Exhibition { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); int M = Integer.parseInt(st.nextToken()); Pic [] p = new Pic[N]; for (int i=0;i<N;i++) { st = new StringTokenizer(br.readLine()); p[i] = new Pic(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken())); } int [] f = new int[M]; for (int i=0;i<M;i++) { f[i] = Integer.parseInt(br.readLine()); } br.close(); Arrays.sort(p); for (Pic x : p) System.out.println(x.v + " " + x.s); Arrays.sort(f); int ans = 0; int ind = M - 1; for (int i=0;i<N;i++) { if (p[i].s<=f[ind]) { ans++; ind--; if (ind<0) break; } } PrintWriter pw = new PrintWriter(System.out); pw.println(ans); pw.close(); } }

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

joi2019_ho_t2.java:14: error: class Exhibition is public, should be declared in a file named Exhibition.java
public class Exhibition {
       ^
1 error

=======