6062 | 2023-10-29 10:13:43 | MCDave | Szorzás gyakorlás | cpp17 | Accepted 100/100 | 3ms | 3704 KiB |
#include <iostream>
#include <set>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> numbers(n);
for (int i = 0; i < n; i++)
{
int temp1;
cin >> temp1;
numbers[i] = temp1;
}
int digit, x=1;
set<int> been;
set<int> alldigit = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
for (int i = 0; i < n; i++)
{
int temp2 = numbers[i];
while (been != alldigit)
{
temp2 = numbers[i] * x;
x++;
while (temp2 != 0)
{
digit = temp2 % 10;
if (!been.count(digit))
{
been.insert(digit);
}
temp2 = temp2 / 10;
}
}
cout << x-1 << endl;
x = 1;
been.clear();
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1812 KiB | ||||
2 | Accepted | 3ms | 2060 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2268 KiB | ||||
subtask3 | 25/25 | ||||||
4 | Accepted | 3ms | 2512 KiB | ||||
5 | Accepted | 3ms | 2704 KiB | ||||
6 | Accepted | 3ms | 2724 KiB | ||||
7 | Accepted | 3ms | 2964 KiB | ||||
8 | Accepted | 3ms | 3056 KiB | ||||
9 | Accepted | 3ms | 3048 KiB | ||||
10 | Accepted | 3ms | 3064 KiB | ||||
11 | Accepted | 3ms | 3148 KiB | ||||
subtask4 | 20/20 | ||||||
12 | Accepted | 3ms | 3144 KiB | ||||
13 | Accepted | 3ms | 3144 KiB | ||||
subtask5 | 40/40 | ||||||
14 | Accepted | 2ms | 3148 KiB | ||||
15 | Accepted | 3ms | 3152 KiB | ||||
16 | Accepted | 3ms | 3288 KiB | ||||
17 | Accepted | 3ms | 3264 KiB | ||||
18 | Accepted | 3ms | 3260 KiB | ||||
19 | Accepted | 3ms | 3396 KiB | ||||
20 | Accepted | 3ms | 3484 KiB | ||||
21 | Accepted | 3ms | 3592 KiB | ||||
22 | Accepted | 3ms | 3572 KiB | ||||
23 | Accepted | 3ms | 3704 KiB |