60142023-10-22 16:35:40BoldiSzorzás gyakorláscpp17Time limit exceeded 0/1001.1s4528 KiB
#include<bits/stdc++.h>

using namespace std;

int solve(int a)
{
    bool nums[9];
    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()
{
    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.065s1348 KiB
2Time limit exceeded1.046s1264 KiB
subtask20/15
3Time limit exceeded1.057s1572 KiB
subtask30/25
4Time limit exceeded1.042s2332 KiB
5Time limit exceeded1.072s2560 KiB
6Time limit exceeded1.049s2784 KiB
7Time limit exceeded1.049s2104 KiB
8Time limit exceeded1.077s2868 KiB
9Time limit exceeded1.08s2100 KiB
10Time limit exceeded1.07s3172 KiB
11Time limit exceeded1.1s2260 KiB
subtask40/20
12Time limit exceeded1.041s3132 KiB
13Time limit exceeded1.054s3380 KiB
subtask50/40
14Time limit exceeded1.057s3504 KiB
15Time limit exceeded1.069s2960 KiB
16Time limit exceeded1.054s4088 KiB
17Time limit exceeded1.07s4140 KiB
18Time limit exceeded1.074s4056 KiB
19Time limit exceeded1.062s3996 KiB
20Time limit exceeded1.07s4108 KiB
21Time limit exceeded1.057s4240 KiB
22Time limit exceeded1.069s4376 KiB
23Time limit exceeded1.077s4528 KiB