제출 #1063240

#제출 시각아이디문제언어결과실행 시간메모리
1063240UnforgettableplArranging Tickets (JOI17_arranging_tickets)C++17
0 / 100
215 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin >> N >> M; vector<pair<int,int>> requests(M); for(auto&[a,b]:requests) { int c;cin>>a>>b>>c; } auto check = [&](int mask) { vector<int> curr(N+1); for(int i=0;i<M;i++) { if(mask&(1<<i)) { for(int x=requests[i].first;x<requests[i].second;x++)curr[x]++; } else { for(int x=1;x<requests[i].first;x++)curr[x]++; for(int x=requests[i].second;x<=N;x++)curr[x]++; } } return *max_element(curr.begin(), curr.end()); }; long long ans = M; for(int mask=0;mask<(1<<M);mask++)ans=min(ans,check(mask)); cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...