6176 | 2023-11-05 13:41:22 | Boldi | Szorzás gyakorlás | cpp17 | Time limit exceeded 0/100 | 1.077s | 4788 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.057s | 1028 KiB | ||||
2 | Time limit exceeded | 1.065s | 1124 KiB | ||||
subtask2 | 0/15 | ||||||
3 | Time limit exceeded | 1.069s | 2160 KiB | ||||
subtask3 | 0/25 | ||||||
4 | Time limit exceeded | 1.077s | 2376 KiB | ||||
5 | Time limit exceeded | 1.057s | 2580 KiB | ||||
6 | Time limit exceeded | 1.036s | 2664 KiB | ||||
7 | Time limit exceeded | 1.044s | 2800 KiB | ||||
8 | Time limit exceeded | 1.069s | 3072 KiB | ||||
9 | Time limit exceeded | 1.065s | 3124 KiB | ||||
10 | Time limit exceeded | 1.069s | 3396 KiB | ||||
11 | Time limit exceeded | 1.065s | 3320 KiB | ||||
subtask4 | 0/20 | ||||||
12 | Time limit exceeded | 1.036s | 3116 KiB | ||||
13 | Time limit exceeded | 1.065s | 3248 KiB | ||||
subtask5 | 0/40 | ||||||
14 | Time limit exceeded | 1.054s | 3484 KiB | ||||
15 | Time limit exceeded | 1.074s | 3688 KiB | ||||
16 | Time limit exceeded | 1.065s | 2872 KiB | ||||
17 | Time limit exceeded | 1.044s | 3672 KiB | ||||
18 | Time limit exceeded | 1.077s | 3912 KiB | ||||
19 | Time limit exceeded | 1.065s | 4032 KiB | ||||
20 | Time limit exceeded | 1.052s | 4424 KiB | ||||
21 | Time limit exceeded | 1.057s | 4616 KiB | ||||
22 | Time limit exceeded | 1.057s | 4580 KiB | ||||
23 | Time limit exceeded | 1.049s | 4788 KiB |