60622023-10-29 10:13:43MCDaveSzorzás gyakorláscpp17Accepted 100/1003ms3704 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();
	}
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1812 KiB
2Accepted3ms2060 KiB
subtask215/15
3Accepted3ms2268 KiB
subtask325/25
4Accepted3ms2512 KiB
5Accepted3ms2704 KiB
6Accepted3ms2724 KiB
7Accepted3ms2964 KiB
8Accepted3ms3056 KiB
9Accepted3ms3048 KiB
10Accepted3ms3064 KiB
11Accepted3ms3148 KiB
subtask420/20
12Accepted3ms3144 KiB
13Accepted3ms3144 KiB
subtask540/40
14Accepted2ms3148 KiB
15Accepted3ms3152 KiB
16Accepted3ms3288 KiB
17Accepted3ms3264 KiB
18Accepted3ms3260 KiB
19Accepted3ms3396 KiB
20Accepted3ms3484 KiB
21Accepted3ms3592 KiB
22Accepted3ms3572 KiB
23Accepted3ms3704 KiB