114022024-09-10 11:21:36GhostSzorzás gyakorláscpp17Accepted 100/1003ms512 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, i;
    cin >> n;
    vector<int> d(n);
    for (i = 0; i < n; i++) {
        cin >> d[i];
    }

    for (i = 0; i < n; i++) {
        int j = 0, x = 0;
        vector<bool> digits(10, false);
        while (x != 10) {
            j++;
            int temp = d[i] * j;
            while (temp > 0) {
                int cd = temp % 10;
                if (!digits[cd]) {
                    digits[cd] = true;
                    x++;
                }
                temp /= 10;
            }
        }
        cout << j << endl;
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted2ms360 KiB
2Accepted2ms360 KiB
subtask215/15
3Accepted2ms360 KiB
subtask325/25
4Accepted3ms424 KiB
5Accepted3ms420 KiB
6Accepted3ms360 KiB
7Accepted3ms384 KiB
8Accepted2ms384 KiB
9Accepted3ms384 KiB
10Accepted3ms360 KiB
11Accepted3ms512 KiB
subtask420/20
12Accepted3ms376 KiB
13Accepted3ms360 KiB
subtask540/40
14Accepted2ms232 KiB
15Accepted3ms360 KiB
16Accepted3ms360 KiB
17Accepted3ms384 KiB
18Accepted3ms232 KiB
19Accepted3ms360 KiB
20Accepted3ms384 KiB
21Accepted3ms384 KiB
22Accepted3ms360 KiB
23Accepted3ms360 KiB