public static void main(String[] args) { Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(System.in))); int n = scanner.nextInt(); int[] count = new int[n], capacity = new int[n]; for (int i = 0; i < n; i++) { count[i] = scanner.nextInt(); } for (int i = 0; i < n; i++) { capacity[i] = scanner.nextInt(); } Arrays.sort(count); Arrays.sort(capacity); long res = 1; int right = n - 1; for (int i = n - 1; i >= 0; i--) { while (right >= 0 && capacity[right] >= count[i]) right--; res *= (n - 1 - right) - (n - 1 - i); res %= 100000007; if (res == 0) break; } System.out.println(res); }
点赞 7

相关推荐

不愿透露姓名的神秘牛友
07-03 16:22
点赞 评论 收藏
分享
ohs的小木屋:比不少实习待遇高了
点赞 评论 收藏
分享
每晚夜里独自颤抖:这个在牛客不是老熟人了吗
点赞 评论 收藏
分享
05-26 22:25
门头沟学院 Java
Java小肖:不会是想叫你过去把你打一顿吧,哈哈哈
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务