func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MAXN = 810, maxn = 200010;   long long n, m, k, top, cnt, num;   struct wy {     long long x, y, z;   } t[maxn];   inline long long cmp(wy a, wy b) { return a.z < b.z; }   long long b[MAXN], c[MAXN], a[MAXN][MAXN], w[maxn];   inline void discrete() {     sort(b + 1, b + 1 + top);     for (long long i = 1; i <= top; ++i)       if (b[i] != b[i - 1]) c[++cnt] = b[i];   }   int main() {     ios::sync_with_stdio(false);     cin >> n >> m >> k;     for (long long i = 1; i <= m; ++i) {       long long x, y, z;       cin >> x >> y >> z;       t[i] = (wy){x, y, z};     }     sort(t + 1, t + 1 + m, cmp);     for (long long i = 1; i <= ((m) > (k) ? (k) : (m)); ++i) {       b[++top] = t[i].x;       b[++top] = t[i].y;     }     discrete();     for (long long i = 1; i <= cnt; ++i)       for (long long j = 1; j <= cnt; ++j) a[i][j] = 20000000000000000ll;     for (long long i = 1; i <= ((m) > (k) ? (k) : (m)); ++i) {       long long x = lower_bound(c + 1, c + 1 + cnt, t[i].x) - c;       long long y = lower_bound(c + 1, c + 1 + cnt, t[i].y) - c;       a[y][x] = a[x][y] = t[i].z;     }     for (long long p = 1; p <= cnt; ++p) {       for (long long i = 1; i <= cnt; ++i)         for (long long j = 1; j <= cnt; ++j) {           a[i][j] =               ((a[i][j]) > (a[i][p] + a[p][j]) ? (a[i][p] + a[p][j]) : (a[i][j]));         }     }     for (long long i = 1; i <= cnt; ++i)       for (long long j = i + 1; j <= cnt; ++j) c[++num] = a[i][j];     sort(c + 1, c + 1 + num);     printf( %lld , c[k]);     return 0;   }   