Language: C++

#include<bits/stdc++.h>
#include<bitset>
#include<random>
#include<time.h>

using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)
#define repb(i, ed, st) for(int i=ed; i>=st; i--)

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;

const long double PI  =3.141592653589793238463;
const int N = 5e5 + 10;
const ll INF = 1LL << 60;

template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}



// Main Code



int main()
{
  int k;
  cin>>k;
  vector<pair<int, int>> edge[k];
  for(int i=0; i<k; i++)
  {
    edge[i].pb({(i+1)%k, 1});
    edge[i].pb({(i*10)%k, 0});
  }
  priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
  vector<bool> vis(k, false);
  pq.push({1, 1});
  while(!pq.empty())
  {
    int curr, dist;
    pair<int, int> p = pq.top();
    pq.pop();
    curr = p.f;
    dist = p.s;
    if(curr == 0)
    {
      cout<<dist<<endl;
      return 0;
    }
    if(vis[curr] == true) continue;
    vis[curr] = true;
    for(auto np: edge[curr])
    {
      pq.push(make_pair{np.f, (np.s + dist)});
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:24: error: expected ')' before '{' token
   62 |       pq.push(make_pair{np.f, (np.s + dist)});
      |              ~         ^
      |                        )
a.cc:62:14: error: no matching function for call to 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > >::push(<unresolved overloaded function type>)'
   62 |       pq.push(make_pair{np.f, (np.s + dist)});
      |       ~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int> >; _Compare = std::greater<std::pair<int, int> >; value_type = std::pair<int, int>]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:30: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > >::value_type&' {aka 'const std::pair<int, int>&'}
  736 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int> >; _Compare = std::greater<std::pair<int, int> >; value_type = std::pair<int, int>]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:25: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > >::value_type&&' {aka 'std::pair<int, int>&&'}
  744 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~