We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main.java.com.poogle.BOJ.Q1931; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[][] meetings = new int[n][2]; for (int i = 0; i < n; i++) { meetings[i][0] = sc.nextInt(); meetings[i][1] = sc.nextInt(); } Arrays.sort(meetings, (o1, o2) -> { if (o1[1] == o2[1]) { return o1[0] - o2[0]; } return o1[1] - o2[1]; }); int answer = 0; int now = 0; for (int i = 0; i < n; i++) { if (now <= meetings[i][0]) { now = meetings[i][1]; answer++; } } System.out.println(answer); } }
The text was updated successfully, but these errors were encountered:
c929669
suhyunsim
No branches or pull requests
문제
핵심 아이디어
가능한 풀이
어려운 점, 실수
풀이
The text was updated successfully, but these errors were encountered: