This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
/*
How
*/
int main(){
int n,m;
std::cin>>n>>m;
if(n>20||m>20)return 35;
std::vector<std::pair<int,int>> nums;
for(int i=0;i<m;i++){
int a,b,c;
std::cin>>a>>b>>c;
a--,b--;
nums.push_back({a,b});
}
int mnmx=20;
for(int i=0;i<(1<<m);i++){
int mx=0;
for(int j=0;j<n;j++){
int nm=0;
for(int k=0;k<m;k++){
if((j>=nums[k].first&&j<nums[k].second)^((i>>k)&1)){
nm++;
}
}
mx=std::max(mx,nm);
}
mnmx=std::min(mnmx,mx);
}
std::cout<<mnmx<<'\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |