fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define IO ios_base::sync_with_stdio(0), cin.tie(0),cout.tie(0)
  4. typedef long long ll;
  5. const int N = 1e5 + 4 , MOD = 1e9 + 7 ;
  6. int n , s , d ;
  7. pair<int, int> p[N] ;
  8. bool ok ;
  9. bool solve(int idx)
  10. {
  11. if(idx == n + 1)
  12. return (ok == 1) ;
  13. if(p[idx].first < s && p[idx].second > d)
  14. ok = 1 ;
  15. solve(idx + 1) ;
  16. return (ok == 1) ;
  17. }
  18. int main() {
  19. IO ;
  20. cin>>n>>s>>d ;
  21. for(int i=1 ; i <= n ; i++)
  22. cin>>p[i].first>>p[i].second ;
  23. if(solve(1) == 1)
  24. cout<<"Yes\n" ;
  25. else
  26. cout<<"No\n" ;
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
No