Language: C++

#include <bits/stdc++.h>                                                                                                                                                                        using namespace std;                                                                                                                                                                                                                                                                                                                                                                            int main() {                                                                                                                                                                                       ios::sync_with_stdio(false);                                                                                                                                                                    cin.tie(0);                                                                                                                                                                                     cout.tie(0);                                                                                                                                                                                    int k;                                                                                                                                                                                          cin >> k;                                                                                                                                                                                       deque<int> q;                                                                                                                                                                                   q.push_back(1);                                                                                                                                                                                 vector<int> dist(k, k+2);                                                                                                                                                                       dist[1] = 1;                                                                                                                                                                                    while(!q.empty()) {                                                                                                                                                                                int node = q.front();                                                                                                                                                                           q.pop_front();                                                                                                                                                                                  if(dist[(node+1)%k] > 1 + dist[node]) {                                                                                                                                                            dist[(node+1)%k] = 1 + dist[node];                                                                                                                                                              q.push_back((node+1)%k);                                                                                                                                                                     }                                                                                                                                                                                               if(dist[(node*10)%k] > dist[node]) {                                                                                                                                                               dist[(node*10)%k] = dist[node];                                                                                                                                                                 q.push_front((node*10)%k);                                                                                                                                                                   }                                                                                                                                                                                            }                                                                                                                                                                                               cout << dist[0] << endl;                                                                                                                                                                     }   

Compiler output:
a.cc:1:193: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>                                                                                                                                                                        using namespace std;                                                                                                                                                                                                                                                                                                                                                                            int main() {                                                                                                                                                                                       ios::sync_with_stdio(false);                                                                                                                                                                    cin.tie(0);                                                                                                                                                                                     cout.tie(0);                                                                                                                                                                                    int k;                                                                                                                                                                                          cin >> k;                                                                                                                                                                                       deque<int> q;                                                                                                                                                                                   q.push_back(1);                                                                                                                                                                                 vector<int> dist(k, k+2);                                                                                                                                                                       dist[1] = 1;                                                                                                                                                                                    while(!q.empty()) {                                                                                                                                                                                int node = q.front();                                                                                                                                                                           q.pop_front();                                                                                                                                                                                  if(dist[(node+1)%k] > 1 + dist[node]) {                                                                                                                                                            dist[(node+1)%k] = 1 + dist[node];                                                                                                                                                              q.push_back((node+1)%k);                                                                                                                                                                     }                                                                                                                                                                                               if(dist[(node*10)%k] > dist[node]) {                                                                                                                                                               dist[(node*10)%k] = dist[node];                                                                                                                                                                 q.push_front((node*10)%k);                                                                                                                                                                   }                                                                                                                                                                                            }                                                                                                                                                                                               cout << dist[0] << endl;                                                                                                                                                                     }
      |                                                                                                                                                                                                 ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status