#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 time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
4188 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
4188 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
4188 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
4188 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |