func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<long long> vis;   vector<pair<long long, long long>> v;   void dfs(long long x, long long y) {     pair<long long, long long> p = v[x];     vis[x] = 1;     if (x == y) return;     for (long long i = 0; i < v.size(); i++) {       if (vis[i]) continue;       if (p.first > v[i].first && p.first < v[i].second) {         dfs(i, y);       } else if (p.second > v[i].first && p.second < v[i].second) {         dfs(i, y);       }     }   }   signed main() {     ios::sync_with_stdio(0);     long long n, m, b, c;     while (cin >> n) {       v.clear();       long long mp[105][105];       for (long long i = 0; i < n; i++) {         cin >> m >> b >> c;         if (m == 2) {           vis.assign(100, 0);           dfs(b - 1, c - 1);           if (vis[c - 1]) {             cout <<  YES n ;           } else {             cout <<  NO n ;           }         }         if (m == 1) {           v.push_back(make_pair(b, c));         }       }     }     return 0;   }   