'commit'
This commit is contained in:
24
GESP/Level4/GESP202312/4_2.cpp
Normal file
24
GESP/Level4/GESP202312/4_2.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
const int N = 100005;
|
||||
int a[N];
|
||||
int b[N], bl = 1;
|
||||
int n;
|
||||
int ans;
|
||||
int main() {
|
||||
scanf("%d", &n);
|
||||
for (int i = 1; i <= n; i++)
|
||||
scanf("%d", &a[i]);
|
||||
|
||||
for (int i = 1; i <= n; i++)
|
||||
scanf("%d", &b[i]);
|
||||
|
||||
sort(a + 1, a + n + 1);
|
||||
sort(b + 1, b + n + 1);
|
||||
|
||||
for (int i = 1; i <= n; i++)
|
||||
if (a[i] > b[bl])
|
||||
++ans, ++bl;
|
||||
printf("%d\n", ans);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user