import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int n = cin.nextInt(); int x[] = new int[n]; int y[] = new int[n]; int temp; int temp1; int count = 0; for(int i=0;i<n;i++){ x[i] = cin.nextInt(); y[i] = cin.nextInt(); } for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if(x[i]>x[j]){ temp = x[j]; temp1 = y[j]; x[j] = x[i]; y[j] = y[i]; x[i] = temp; y[i] = temp1; } } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(j!=i){ if(x[i]<x[j]&&y[i]<y[j]){ count=0; break; } count += 1; if(count == n-1){ count=0; System.out.println(x[i]+" "+y[i]); } } } } } } 自己在下面写的;不知道能不能通过
点赞 评论

相关推荐

在写周报的打工人很独...:这个笔试昨天晚上做了一下,真难啊,前后端,ai全有
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务