6177 | 2023-11-05 13:43:32 | Boldi | Szorzás gyakorlás | cpp17 | Time limit exceeded 0/100 | 1.098s | 3864 KiB |
#include<bits/stdc++.h>
using namespace std;
int solve(int a)
{
bool nums[10];
int cnt=0, m=0;
while(cnt<10){
m++;
int x=a*m;
while(x>0){
if(!nums[x%10]){
cnt++;
nums[x%10]=true;
}
x/=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;
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Time limit exceeded | 1.059s | 2148 KiB | ||||
2 | Time limit exceeded | 1.065s | 2540 KiB | ||||
subtask2 | 0/15 | ||||||
3 | Time limit exceeded | 1.072s | 2528 KiB | ||||
subtask3 | 0/25 | ||||||
4 | Time limit exceeded | 1.044s | 1612 KiB | ||||
5 | Time limit exceeded | 1.077s | 1792 KiB | ||||
6 | Time limit exceeded | 1.06s | 2740 KiB | ||||
7 | Time limit exceeded | 1.069s | 2888 KiB | ||||
8 | Time limit exceeded | 1.069s | 2240 KiB | ||||
9 | Time limit exceeded | 1.069s | 2948 KiB | ||||
10 | Time limit exceeded | 1.059s | 3224 KiB | ||||
11 | Time limit exceeded | 1.077s | 3092 KiB | ||||
subtask4 | 0/20 | ||||||
12 | Time limit exceeded | 1.072s | 2432 KiB | ||||
13 | Time limit exceeded | 1.052s | 2512 KiB | ||||
subtask5 | 0/40 | ||||||
14 | Time limit exceeded | 1.098s | 3288 KiB | ||||
15 | Time limit exceeded | 1.065s | 3356 KiB | ||||
16 | Time limit exceeded | 1.062s | 3584 KiB | ||||
17 | Time limit exceeded | 1.069s | 3584 KiB | ||||
18 | Time limit exceeded | 1.072s | 3696 KiB | ||||
19 | Time limit exceeded | 1.037s | 3732 KiB | ||||
20 | Time limit exceeded | 1.044s | 3740 KiB | ||||
21 | Time limit exceeded | 1.077s | 3732 KiB | ||||
22 | Time limit exceeded | 1.082s | 2940 KiB | ||||
23 | Time limit exceeded | 1.077s | 3864 KiB |