6178 | 2023-11-05 13:51:11 | Boldi | Szorzás gyakorlás | cpp17 | Accepted 100/100 | 3ms | 4472 KiB |
#include<bits/stdc++.h>
using namespace std;
int solve(int a)
{
vector<bool>nums(10, false);
int cnt=0, m=0;
while(cnt<10){
m++;
long long k=a*m;
while(k>0){
if(!nums[k%10]){
cnt++;
nums[k%10]=true;
}
k/=10;
}
}
return m;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n; cin>>n;
for(int i=0;i<n;i++){
int x; cin>>x;
cout<<solve(x)<<endl;
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1892 KiB | ||||
2 | Accepted | 3ms | 2232 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2348 KiB | ||||
subtask3 | 25/25 | ||||||
4 | Accepted | 3ms | 2576 KiB | ||||
5 | Accepted | 3ms | 2804 KiB | ||||
6 | Accepted | 3ms | 3276 KiB | ||||
7 | Accepted | 3ms | 3264 KiB | ||||
8 | Accepted | 3ms | 3388 KiB | ||||
9 | Accepted | 3ms | 3472 KiB | ||||
10 | Accepted | 3ms | 3728 KiB | ||||
11 | Accepted | 3ms | 3900 KiB | ||||
subtask4 | 20/20 | ||||||
12 | Accepted | 3ms | 3892 KiB | ||||
13 | Accepted | 3ms | 4104 KiB | ||||
subtask5 | 40/40 | ||||||
14 | Accepted | 3ms | 4196 KiB | ||||
15 | Accepted | 3ms | 4364 KiB | ||||
16 | Accepted | 3ms | 4236 KiB | ||||
17 | Accepted | 3ms | 4236 KiB | ||||
18 | Accepted | 3ms | 4228 KiB | ||||
19 | Accepted | 3ms | 4356 KiB | ||||
20 | Accepted | 3ms | 4360 KiB | ||||
21 | Accepted | 3ms | 4368 KiB | ||||
22 | Accepted | 3ms | 4372 KiB | ||||
23 | Accepted | 3ms | 4472 KiB |