Submission #440572

#TimeUsernameProblemLanguageResultExecution timeMemory
440572colossal_pepeSpiderman (COCI20_spiderman)C++17
35 / 70
71 ms9096 KiB
#include <iostream> using namespace std; int n, k, city[100005], 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] : 0) << ' '; } cout << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...