func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5;   int R[N], czy[N], dp[N], siz[N];   pair<int, int> E[N], E2[N];   int M;   pair<int, int> Find(int x) {     if (x == R[x]) return {x, 0};     pair<int, int> a = Find(R[x]);     a.second ^= czy[x];     return a;   }   void Union(int a, int b) {     if (a == b) return;     if (siz[a] > siz[b]) swap(a, b);     siz[b] += siz[a];     R[a] = b;     czy[a] ^= 1 ^ czy[b];     czy[b] = 0;   }   void sep(int a, int b) {     if (a == b) return;     czy[a] = 0;     czy[b] = 0;     if (siz[a] > siz[b]) swap(a, b);     siz[b] -= siz[a];     R[a] = a;   }   void solve(int l, int r, int a, int b) {     if (l > r) return;     int m = (l + r) >> 1;     dp[m] = N;     for (int i = l; i < m; i++) {       pair<int, int> A = Find(E[i].first), B = Find(E[i].second);       E2[i] = {A.first, B.first};       if (A.first == B.first && (A.second ^ B.second ^ 1)) {         dp[m] = i;         break;       }       if (A.first != B.first) {         czy[A.first] = A.second;         czy[B.first] = B.second;       }       Union(A.first, B.first);     }     if (dp[m] < m) {       for (int i = dp[m] - 1; i >= l; i--) sep(E2[i].first, E2[i].second);       solve(l, dp[m], a, b);       for (int i = dp[m] + 1; i <= r; i++) dp[i] = b;       return;     }     for (int i = b; i >= a; i--) {       if (i < m) {         dp[m] = m - 1;         break;       }       pair<int, int> A = Find(E[i].first), B = Find(E[i].second);       E2[i] = {A.first, B.first};       if (A.first == B.first && (A.second ^ B.second ^ 1)) {         dp[m] = i;         break;       }       if (A.first != B.first) {         czy[A.first] = A.second;         czy[B.first] = B.second;       }       Union(A.first, B.first);     }     for (int i = dp[m] + 1; i <= b; i++) sep(E2[i].first, E2[i].second);     pair<int, int> A = Find(E[m].first), B = Find(E[m].second);     if (A.first == B.first && (A.second ^ B.second ^ 1)) {       for (int i = m + 1; i <= r; i++) dp[i] = b;     } else {       if (A.first != B.first) {         czy[A.first] = A.second;         czy[B.first] = B.second;       }       Union(A.first, B.first);       solve(m + 1, r, dp[m], b);       sep(A.first, B.first);     }     for (int i = m - 1; i >= l; i--) {       sep(E2[i].first, E2[i].second);     }     for (int i = b; i > dp[m]; i--) {       A = Find(E[i].first), B = Find(E[i].second);       E2[i] = {A.first, B.first};       if (A.first != B.first) {         czy[A.first] = A.second;         czy[B.first] = B.second;       }       Union(A.first, B.first);     }     solve(l, m - 1, a, dp[m]);     for (int i = dp[m] + 1; i <= b; i++) sep(E2[i].first, E2[i].second);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int n, m, q;     cin >> n >> m >> q;     M = m;     for (int i = 1; i <= n + 2; i++) {       R[i] = i;       siz[i] = 1;     }     for (int i = 1; i <= m; i++) {       cin >> E[i].first >> E[i].second;     }     E[m + 1] = {n + 1, n + 2};     solve(1, m, 0, m + 1);     while (q--) {       int l, r;       cin >> l >> r;       if (r >= dp[l])         cout <<  NO n ;       else         cout <<  YES n ;     }   }   