#include <bits/c++.h>
using namespace std;
#define INF 2000000000
typedef pair<int, int> pii;
const int MAX_N = 50;
int N;
vector<pii> v1, v2;
int ans = INF;
int idx[MAX_N+1];
int chk[MAX_N+1];
int sum = 0;
void dfs(int x){
if(x==N){
ans = min(ans,sum); return;
}
for(int i=0; i<N; i++){
if(chk[i]==0 && v1[x].second<=v2[i].second){
chk[i]=1;
if(v1[x].first!=v2[i].first){
sum++;
}
dfs(x+1);
chk[i] = 0;
if(v1[x].first!=v2[i].first){
sum--;
}
}else if(v1[x].second>v2[i].second){
return;
}
}
}
int main(){
scanf("%d", &N);
for(int i=0; i<N; i++){
int a, b; scanf("%d%d", &a, &b);
v1.push_back({a, b});
}
for(int i=0; i<N; i++){
int a, b; scanf("%d%d", &a, &b);
s.push_back({a, b});
}
dfs(0);
printf("%d", ans);
return 0;
}
Compilation message
worst_reporter2.cpp:1:10: fatal error: bits/c++.h: No such file or directory
#include <bits/c++.h>
^~~~~~~~~~~~
compilation terminated.