public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n=in.nextInt(); int q; int z; TreeMap<Integer,Integer> map=new TreeMap<Integer,Integer>(); for(int i=0;i<n;i++) { q =in.nextInt(); z=in.nextInt(); for(int j=q;j<z;j++) { if(map.get(j)==null) map.put(j,1); else { int value=map.get(j).intValue(); value++; map.put(j,value); } } } Collection<Integer> c=map.values(); int x=Collections.max(c); System.out.println(x); / }}
点赞 评论

相关推荐

06-04 16:50
腾讯_TEG_技术
点赞 评论 收藏
分享
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务