61772023-11-05 13:43:32BoldiSzorzás gyakorláscpp17Time limit exceeded 0/1001.098s3864 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;
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Time limit exceeded1.059s2148 KiB
2Time limit exceeded1.065s2540 KiB
subtask20/15
3Time limit exceeded1.072s2528 KiB
subtask30/25
4Time limit exceeded1.044s1612 KiB
5Time limit exceeded1.077s1792 KiB
6Time limit exceeded1.06s2740 KiB
7Time limit exceeded1.069s2888 KiB
8Time limit exceeded1.069s2240 KiB
9Time limit exceeded1.069s2948 KiB
10Time limit exceeded1.059s3224 KiB
11Time limit exceeded1.077s3092 KiB
subtask40/20
12Time limit exceeded1.072s2432 KiB
13Time limit exceeded1.052s2512 KiB
subtask50/40
14Time limit exceeded1.098s3288 KiB
15Time limit exceeded1.065s3356 KiB
16Time limit exceeded1.062s3584 KiB
17Time limit exceeded1.069s3584 KiB
18Time limit exceeded1.072s3696 KiB
19Time limit exceeded1.037s3732 KiB
20Time limit exceeded1.044s3740 KiB
21Time limit exceeded1.077s3732 KiB
22Time limit exceeded1.082s2940 KiB
23Time limit exceeded1.077s3864 KiB