# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
440579 | colossal_pepe | Spiderman (COCI20_spiderman) | C++17 | 167 ms | 10176 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
int n, k, city[300005], cnt[1000005], divisors[1000005];
int main() {
cin >> n >> k;
for (int i = 0; i < n; i++) {
cin >> city[i];
cnt[city[i]] += 1;
}
for (int i = k + 1; i < 1000005; i++) {
for (int j = 0; j < 1000005; j += i) {
divisors[j] += cnt[i];
}
}
for (int i = 0; i < n; i++) {
cout << (city[i] >= k ? divisors[city[i] - k] - (k == 0): 0) << ' ';
}
cout << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |