update
This commit is contained in:
parent
149e6c4249
commit
c11cc27036
32
src/20241121/U504523.cpp
Normal file
32
src/20241121/U504523.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
using ll =int64_t;
|
||||||
|
|
||||||
|
const ll maxn{ll(1e6+5)};
|
||||||
|
ll a[maxn],d[maxn];
|
||||||
|
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
ios::sync_with_stdio(false);
|
||||||
|
cin.tie(0);
|
||||||
|
int n;
|
||||||
|
cin >> n;
|
||||||
|
for(int i=0;i<n;i++){
|
||||||
|
cin >> a[i] >> d[i];
|
||||||
|
}
|
||||||
|
sort(a, a+n);
|
||||||
|
sort(d,d+n);
|
||||||
|
int j = 0;
|
||||||
|
int k = 0;
|
||||||
|
for(int i=0;i<n;i++){
|
||||||
|
if(a[i] > d[j]){
|
||||||
|
k++;
|
||||||
|
j++;
|
||||||
|
if(j == n){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cout << (n - k) <<'\n';
|
||||||
|
}
|
1
src/20241121/card/card1.ans
Normal file
1
src/20241121/card/card1.ans
Normal file
@ -0,0 +1 @@
|
|||||||
|
4
|
6
src/20241121/card/card1.in
Normal file
6
src/20241121/card/card1.in
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
5
|
||||||
|
6 7
|
||||||
|
5 8
|
||||||
|
6 9
|
||||||
|
3 6
|
||||||
|
3 4
|
1
src/20241121/card/card2.ans
Normal file
1
src/20241121/card/card2.ans
Normal file
@ -0,0 +1 @@
|
|||||||
|
750215
|
1000001
src/20241121/card/card2.in
Normal file
1000001
src/20241121/card/card2.in
Normal file
File diff suppressed because it is too large
Load Diff
1
src/20241121/card/card3.ans
Normal file
1
src/20241121/card/card3.ans
Normal file
@ -0,0 +1 @@
|
|||||||
|
138
|
1000001
src/20241121/card/card3.in
Normal file
1000001
src/20241121/card/card3.in
Normal file
File diff suppressed because it is too large
Load Diff
1
src/20241121/card/card4.ans
Normal file
1
src/20241121/card/card4.ans
Normal file
@ -0,0 +1 @@
|
|||||||
|
500739
|
1000001
src/20241121/card/card4.in
Normal file
1000001
src/20241121/card/card4.in
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user