61762023-11-05 13:41:22BoldiSzorzás gyakorláscpp17Time limit exceeded 0/1001.077s4788 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.057s1028 KiB
2Time limit exceeded1.065s1124 KiB
subtask20/15
3Time limit exceeded1.069s2160 KiB
subtask30/25
4Time limit exceeded1.077s2376 KiB
5Time limit exceeded1.057s2580 KiB
6Time limit exceeded1.036s2664 KiB
7Time limit exceeded1.044s2800 KiB
8Time limit exceeded1.069s3072 KiB
9Time limit exceeded1.065s3124 KiB
10Time limit exceeded1.069s3396 KiB
11Time limit exceeded1.065s3320 KiB
subtask40/20
12Time limit exceeded1.036s3116 KiB
13Time limit exceeded1.065s3248 KiB
subtask50/40
14Time limit exceeded1.054s3484 KiB
15Time limit exceeded1.074s3688 KiB
16Time limit exceeded1.065s2872 KiB
17Time limit exceeded1.044s3672 KiB
18Time limit exceeded1.077s3912 KiB
19Time limit exceeded1.065s4032 KiB
20Time limit exceeded1.052s4424 KiB
21Time limit exceeded1.057s4616 KiB
22Time limit exceeded1.057s4580 KiB
23Time limit exceeded1.049s4788 KiB