60152023-10-22 16:37:30BoldiSzorzás gyakorláscpp17Time limit exceeded 0/1001.085s4460 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()
{
    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.065s1848 KiB
2Time limit exceeded1.037s2096 KiB
subtask20/15
3Time limit exceeded1.069s2300 KiB
subtask30/25
4Time limit exceeded1.052s2336 KiB
5Time limit exceeded1.049s2856 KiB
6Time limit exceeded1.065s2564 KiB
7Time limit exceeded1.065s2760 KiB
8Time limit exceeded1.065s2832 KiB
9Time limit exceeded1.065s3088 KiB
10Time limit exceeded1.042s3332 KiB
11Time limit exceeded1.069s3484 KiB
subtask40/20
12Time limit exceeded1.054s3268 KiB
13Time limit exceeded1.08s3272 KiB
subtask50/40
14Time limit exceeded1.054s2632 KiB
15Time limit exceeded1.06s3376 KiB
16Time limit exceeded1.06s2728 KiB
17Time limit exceeded1.057s3476 KiB
18Time limit exceeded1.057s3708 KiB
19Time limit exceeded1.074s4076 KiB
20Time limit exceeded1.049s4088 KiB
21Time limit exceeded1.052s4316 KiB
22Time limit exceeded1.072s4432 KiB
23Time limit exceeded1.085s4460 KiB