fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define ll long long int
  5. int main() {
  6. // your code goes here
  7. ll t;
  8. cin>>t;
  9. pair<ll,ll> min_wid={1e9,1e9},min_hig={1e9,1e9};
  10. while(t--)
  11. {
  12. ll a,x,y;
  13. cin>>a>>x>>y;
  14. if(y>x)
  15. {
  16. swap(x,y);
  17. }
  18. if(a==0)
  19. {
  20. if(min_hig.first<x)
  21. {
  22. min_hig = {x,y};
  23. }
  24. if(min_wid.second < y)
  25. {
  26. min_wid = {x,y};
  27. }
  28.  
  29. }
  30. else
  31. {
  32. if(x<=min_hig.first && min_wid.second>=y)
  33. {
  34. cout<<"Yes\n";
  35. }
  36. else
  37. {
  38. cout<<"No\n";
  39. }
  40. }
  41. }
  42. return 0;
  43. }
Success #stdin #stdout 0s 5304KB
stdin
2
0 5 5
1 2 2
stdout
Yes