Language: C++

//#include <bits/stdc++.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <functional>
#include <map>
#include <ios>
#include <iosfwd>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <conio.h>
#include <numeric>
#include <list>
#include <windows.h>
#include <cfloat>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;

template<typename T> bool getint(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(;(t>'9'||t<'0')&&t!='-'&&t!=EOF;t=getchar());
	if(t=='-') neg=true,t=getchar(); if(t==EOF)return false;
	for(;t<='9'&&t>='0';t=getchar()) x=x*10+t-'0';
	if(neg) x=-x;
	return true;
}
template<typename T> void printint(T x)
{
	if(x<0) putchar('-'),x=-x;
	short a[20]={},sz=0;
	while(x>0) a[sz++]=x%10,x/=10;
	if(sz==0) putchar('0');
	for(int i=sz-1;i>=0;i--) putchar('0'+a[i]);
}

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef float fl;
typedef double ld;
typedef pair<int,int> pii;
#define ui(n) ((unsigned int)(n))
#define ll(n) ((long long)(n))
#define ull(n) ((unsigned long long)(n))
#define fl(n) ((float)(n))
#define ld(n) ((double)(n))
#define fixpoint(n) fixed<<setprecision(n)
const int INF=1e9+7;
const ll LINF=1e18;
#define m_p make_pair
#define all(a) (a).begin(),(a).end()
#define pall(a) (a).rbegin(),(a).rend()
#define mod 1000000007
#define sz(a) ((int)(a).size())
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repa(i,a,n) for(int i=a;i<n;i++)
#define repv(itr,v) for(__typeof((v).begin()) itr=(v).begin();itr!=(v).end();itr++) 
#define sqr(x) ((x)*(x))
#define filein(x) freopen(x,"r",stdin)
#define fileout(x) freopen(x,"w",stdout)

ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}

int k,dist[100010];
bool used[100010];
deque<int> q;

inline void add_front(int x,int d)
{
	if(d<dist[x])
	{
		dist[x]=d;
		q.push_front(x);
	}
}

inline void add_back(int x,int d)
{
	if(d<dist[x])
	{
		dist[x]=d;
		q.push_back(x);
	}
}

int main()
{
	cin>>k;
	fill(dist,dist+100000,INF);
	
	add_front(1,0);
	while(!q.empty())
	{
		/*
		repv(i,q) cout<<*i<<' ';
		cout<<endl;
		*/
		int x=q[0];q.pop_front();
		
		if(used[x]) continue;
		used[x]=1;
		
		int d=dist[x],cx=x*10%k;
		add_front(cx,d);
		
		cx=(x+1)%k;
		add_back(cx,d+1);
	}
	
	cout<<dist[0]+1;
	
	return 0;
}

Compiler output:
a.cc:54:10: fatal error: conio.h: No such file or directory
   54 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.