题解:AT_arc224_a [ARC224A] Attach 00
注意到
暴力枚举即可
#include <unordered_map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <cstring>
#include <vector>
#include <bitset>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <map>
#include <set>
#define ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define c1(x) __builtin_popcount(x)
#define ri register
#define il inline
#define uint unsigned long long
#define lowbit(x) x&-x
#define int long long
#define i128 __int128
#define pb push_back
#define db double
using namespace std;
typedef pair<int,int> pii;
typedef pair<db,db> pdd;
template<class T>
void read(T &a,bool f=0,char ch=getchar())
{
for(a=0;ch<'0'||ch>'9';ch=getchar()) ch=='-' ?f=1:0;
for(;ch>='0'&&ch<='9';ch=getchar()) a=(a<<3)+(a<<1)+(ch-'0');
a=f?-a:a;
}
template<class T,class... Y>
void read(T &t,Y &... a)
{
read(t);read(a...);
}
int count0(int x)
{
int res=0;
vector<int> v;
while(x)
{
v.pb(x%10);
x/=10;
}
for(int i=0;i<v.size();i++)
{
if(v[i]!=0) continue;
int j=i;
while(j+1<v.size()&&v[j+1]==0) j++;
res=max(res,j-i+1);
i=j;
}
return res;
}
signed main()
{
int T;
cin>>T;
while(T--)
{
int k;
cin>>k;
for(int j=1;j<=100;j++)
{
if(count0(j*k)>=2)
{
cout<<j*k<<"\n";
break;
}
}
}
return 0;
}