Submission #913821

#TimeUsernameProblemLanguageResultExecution timeMemory
91382112345678Port Facility (JOI17_port_facility)C++17
0 / 100
5 ms4188 KiB
#include <bits/stdc++.h> using namespace std; const int nx=1e6+5, mod=1e9+7; int n, cnt, f, p[nx]; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n; p[0]=1; for (int i=1; i<nx; i++) p[i]=(p[i-1]*2)%mod; vector<pair<int, int>> v(n); for (auto &[x, y]:v) cin>>x>>y; sort(v.begin(), v.end()); for (int i=0; i<n; i++) { int tmp=0; for (int j=0; j<i; j++) if (v[j].second<v[i].second&&v[j].second>v[i].first) tmp++; f|=(tmp>1); if (tmp==0) cnt++; } if (f) cout<<0; else cout<<p[cnt]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...