반응형
문제
- 링크: https://softeer.ai/practice/7695
풀이
더보기
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int locX = 1_000;
int locY = 1_000;
for (int i = 0; i < n; ++i) {
int x = sc.nextInt();
int y = sc.nextInt();
if (y == locY) {
if (x < locX) {
locX = x;
}
} else if (y < locY) {
locX = x;
locY = y;
}
}
System.out.printf("%d %d", locX, locY);
}
}
반응형
'코딩테스트 문제집 > Softeer(Lv1): FIN' 카테고리의 다른 글
[Softeer] Lv1: 효도의 시작(7724) (0) | 2025.02.09 |
---|---|
[Softeer] Lv1: 개표(7698) (0) | 2025.02.09 |
[Softeer] Lv1: 연탄 배달의 시작(7626) (0) | 2025.02.09 |
[Softeer] Lv1: 나무 심기(7353) (0) | 2025.02.09 |
[Softeer] Lv1: A+B(6295) (0) | 2025.02.09 |