func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long N = 2e5 + 10;   const long long inf = 1e18;   long long n, m, Q, E[N][3], l[N], r[N], op[N];   long long hd[N], ht = 1, tf[N], id[N];   long long cnt = 0;   struct edge {     long long v, w, n;   } e[N * 2];   void addedge(long long u, long long v, long long w) {     e[++ht] = (edge){v, w, hd[u]};     hd[u] = ht;   }   long long diss[N], dist[N];   priority_queue<pair<long long, long long> > q;   pair<long long, long long> qtmp;   void Dijkstra(long long S, long long T, bool typed, long long typef,                 long long u = 0) {     memset((typed ? dist : diss), 0x3f, sizeof((typed ? dist : diss)));     (typed ? dist : diss)[S] = 0;     q.push(make_pair(0, S));     while (!q.empty()) {       qtmp = q.top();       q.pop();       if (qtmp.first != -(typed ? dist : diss)[u = qtmp.second]) continue;       for (long long i = hd[u], v; i; i = e[i].n) {         v = e[i].v;         if ((typed ? dist : diss)[v] > (typed ? dist : diss)[u] + e[i].w) {           tf[v] = i >> 1;           (typed ? dist : diss)[v] = (typed ? dist : diss)[u] + e[i].w;           if (typef == 1 && !op[v]) l[v] = l[u];           if (typef == 2 && !op[v]) r[v] = r[u];           q.push(make_pair(-(typed ? dist : diss)[v], v));         }       }     }   }   long long t[N << 3];   void build(long long k, long long l, long long r) {     t[k] = inf;     if (l == r) return;     long long mid = (l + r) >> 1;     build(k << 1, l, mid);     build(k << 1 | 1, mid + 1, r);   }   void modify(long long k, long long l, long long r, long long L, long long R,               long long x) {     if (R < l || r < L) return;     if (L <= l && r <= R) {       t[k] = min(t[k], x);       return;     }     long long mid = (l + r) >> 1;     modify(k << 1, l, mid, L, R, x);     modify(k << 1 | 1, mid + 1, r, L, R, x);   }   long long query(long long k, long long l, long long r, long long x) {     if (l == r) return t[k];     long long mid = (l + r) >> 1;     if (x <= mid)       return min(t[k], query(k << 1, l, mid, x));     else       return min(t[k], query(k << 1 | 1, mid + 1, r, x));   }   signed main() {     scanf( %lld%lld%lld , &n, &m, &Q);     memset(id, -1, sizeof(id));     for (long long i = 1; i <= m; i++) {       scanf( %lld%lld%lld , &E[i][0], &E[i][1], &E[i][2]);       addedge(E[i][0], E[i][1], E[i][2]);       addedge(E[i][1], E[i][0], E[i][2]);       id[i] = -1;     }     Dijkstra(n, 1, 1, 0);     op[1] = 1, l[1] = r[1] = 0;     for (long long i = 1, x = 1, tmp; x != n; i++) {       id[tmp = tf[x]] = i, ++cnt;       op[x ^= E[tmp][0] ^ E[tmp][1]] = 1;       l[x] = r[x] = i;     }     Dijkstra(1, n, 0, 1);     Dijkstra(n, 1, 1, 2);     build(1, 1, cnt);     for (long long i = 1; i <= m; i++)       if (!~id[i]) {         modify(1, 1, cnt, l[E[i][0]] + 1, r[E[i][1]],                diss[E[i][0]] + E[i][2] + dist[E[i][1]]);         modify(1, 1, cnt, l[E[i][1]] + 1, r[E[i][0]],                diss[E[i][1]] + E[i][2] + dist[E[i][0]]);       }     long long ans, tmpw;     for (long long i = 1, tmp; i <= Q; i++) {       scanf( %lld%lld , &tmp, &tmpw);       ans = diss[n];       if (id[tmp] != -1) {         ans -= E[tmp][2] - tmpw;         if (tmpw > E[tmp][2]) ans = min(ans, query(1, 1, cnt, id[tmp]));       } else {         if (tmpw < E[tmp][2]) {           ans = min(ans, diss[E[tmp][0]] + tmpw + dist[E[tmp][1]]);           ans = min(ans, diss[E[tmp][1]] + tmpw + dist[E[tmp][0]]);         }       }       printf( %lld n , ans);     }     return 0;   }   