You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
600 B

#include <bits/stdc++.h>
using namespace std;
int main() {
//输入+输出重定向
freopen("../1291.txt", "r", stdin);
int m, n;
cin >> m >> n;
vector<int> a(m + 1, 0);
vector<int> b(n + 1, 0);
for (int i = 1; i <= m; i++) {
cin >> a[i];
}
for (int i = 1; i <= n; i++) {
cin >> b[i];
}
int count = 0;
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if (a[i] > b[j])count++;
}
}
cout << count << endl;
//关闭文件
fclose(stdin);
return 0;
}