11780 | 2024-11-10 16:51:29 | Mittomen | Szorzás gyakorlás | cpp17 | Accepted 100/100 | 1ms | 500 KiB |
#include <iostream>
#include <string>
#include <cstdint>
#include <bitset>
using namespace std;
int get_solution(uint32_t k) {
bitset<10> set;
int i = 1;
while (!set.all()) {
for (char& chr : to_string(k* i)) {
set.set(chr - '0');
}
i++;
}
return i - 1;
}
int main() {
uint16_t n;
cin >> n;
int* solutions = (int*) malloc(n * sizeof(int));
uint32_t k;
for (uint8_t i = 0; i < n; i++) {
cin >> k;
solutions[i] = get_solution(k);
}
for (uint8_t i = 0; i < n; i++) {
cout << solutions[i] << endl;
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 320 KiB | ||||
2 | Accepted | 1ms | 320 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 1ms | 500 KiB | ||||
subtask3 | 25/25 | ||||||
4 | Accepted | 1ms | 320 KiB | ||||
5 | Accepted | 1ms | 320 KiB | ||||
6 | Accepted | 1ms | 320 KiB | ||||
7 | Accepted | 1ms | 392 KiB | ||||
8 | Accepted | 1ms | 320 KiB | ||||
9 | Accepted | 1ms | 320 KiB | ||||
10 | Accepted | 1ms | 320 KiB | ||||
11 | Accepted | 1ms | 320 KiB | ||||
subtask4 | 20/20 | ||||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Accepted | 1ms | 360 KiB | ||||
subtask5 | 40/40 | ||||||
14 | Accepted | 1ms | 320 KiB | ||||
15 | Accepted | 1ms | 320 KiB | ||||
16 | Accepted | 1ms | 320 KiB | ||||
17 | Accepted | 1ms | 320 KiB | ||||
18 | Accepted | 1ms | 320 KiB | ||||
19 | Accepted | 1ms | 320 KiB | ||||
20 | Accepted | 1ms | 408 KiB | ||||
21 | Accepted | 1ms | 320 KiB | ||||
22 | Accepted | 1ms | 320 KiB | ||||
23 | Accepted | 1ms | 320 KiB |