func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAX = 2e5 + 5;   int n, k, a;   int vis_time[MAX], vis_cnt[MAX], ans;   struct data {     int size, op;     bool operator<(data b) const {       if (size == b.size)         return op > b.op;       else         return size < b.size;     }   };   priority_queue<data> line;   int main() {     scanf( %d%d , &n, &k);     for (register int i = 1; i <= n; ++i) {       scanf( %d , &a);       line.push((data){a, 0});     }     ans = 0x3f3f3f3f;     while (!line.empty()) {       data tmp = line.top();       line.pop();       int size = tmp.size, op = tmp.op;       vis_time[size]++;       vis_cnt[size] += op;       if (vis_time[size] == k) {         ans = min(ans, vis_cnt[size]);       }       if (!size)         continue;       else         line.push((data){size / 2, op + 1});     }     printf( %d n , ans);     return 0;   }   