‘’‘java
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int[] g = new int[a];
int[] s = new int[b];
for(int i = 0; i < a; i++) {
g[i] = sc.nextInt();
}
for(int i = 0; i < b; i++) {
s[i] = sc.nextInt();
}
Arrays.sort(g);
Arrays.sort(s);
int count = 0;
int n = 0;
for(int i = 0;i
for(int j = n;j
n++;
if(g[i]<=s[j]){
count++;
break;
}
}
}
System.out.println(count);
}
}
‘’’
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)