func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m = 1;   vector<vector<int> > edge(105);   int from[105];   int to[105];   bool bfs(int a, int b) {     int use[105] = {0};     queue<int> q;     q.push(a);     use[a] = 1;     while (!q.empty()) {       int cur = q.front();       q.pop();       for (int i = 0; i < edge[cur].size(); i++) {         if (edge[cur][i] == b) return true;         if (use[edge[cur][i]] == 0) {           q.push(edge[cur][i]);           use[edge[cur][i]] = 1;         }       }     }     return false;   }   int main() {     cin >> n;     for (int i = 0; i < n; i++) {       int t, x, y;       cin >> t >> x >> y;       if (t == 1) {         from[m] = x;         to[m] = y;         for (int j = 1; j < m; j++) {           if ((from[j] < x && x < to[j] && y >= to[j]) ||               (from[j] < y && y < to[j]) && x <= from[j]) {             edge[j].push_back(m);             edge[m].push_back(j);           } else if (x <= from[j] && y >= to[j]) {             edge[j].push_back(m);           }         }         m++;       } else {         if (bfs(x, y))           cout <<  YES  << endl;         else           cout <<  NO  << endl;       }     }     return 0;   }   