func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5;   int a[N], b[N], par[N], val[N], sz[N], lst[N];   vector<int> his;   pair<int, int> get(int v) {     if (par[v] == v) return make_pair(v, val[v]);     pair<int, int> g = get(par[v]);     g.second ^= val[v];     return g;   }   bool merge(int u, int v) {     pair<int, int> gu = get(u), gv = get(v);     u = gu.first;     v = gv.first;     if (u == v) return false;     if (sz[v] < sz[u]) swap(u, v), swap(gu, gv);     par[u] = v;     val[u] = gu.second ^ gv.second ^ 1;     sz[v] += sz[u];     his.push_back(u);     return true;   }   void undo(int cnt) {     while (cnt--) {       int u = his.back();       his.pop_back();       sz[par[u]] -= sz[u];       par[u] = u;       val[u] = 0;     }   }   void solve(int l, int r, int R) {     if (r < l) return;     int m = (l + r) >> 1, cnt = 0;     for (int i = l; i < m; i++)       if (merge(a[i], b[i])) cnt++;     if (l < r) {       bool f = merge(a[m], b[m]);       solve(m + 1, r, R);       if (f) undo(1);     }     lst[m] = m;     for (int i = R; i >= m; i--) {       if (get(a[i]) == get(b[i])) {         lst[m] = i;         break;       }       if (merge(a[i], b[i])) cnt++;     }     undo(cnt);     cnt = 0;     for (int i = R; i > lst[m]; i--)       if (merge(a[i], b[i])) cnt++;     solve(l, m - 1, lst[m]);     undo(cnt);   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, m, q;     cin >> n >> m >> q;     for (int i = 1; i <= m; i++) cin >> a[i] >> b[i], lst[i] = m + 1;     for (int i = 1; i <= n; i++) par[i] = i, sz[i] = 1;     int ptr = 1;     while (ptr <= m && get(a[ptr]) != get(b[ptr])) merge(a[ptr], b[ptr]), ptr++;     if (m < ptr) {       while (q--) cout <<  NO n ;       return 0;     }     undo(his.size());     solve(1, ptr, m);     while (q--) {       int l, r;       cin >> l >> r;       cout << (ptr < l || r < lst[l] ?  YES  :  NO ) <<   n ;     }     return 0;   }   