#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
long long n, k, arr[N], cnt[N], ans[N];
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
cin >> n >> k;
for(int i = 1; i <= n; i++){
cin >> arr[i];
cnt[arr[i]]++;
}
for(int i = k + 1; i < N; i++){
for(int j = k; j < N; j += i){
ans[j] += cnt[i];
}
}
for(int i = 1; i <= n; i++) cout << ans[arr[i]] << " ";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
42 ms |
11092 KB |
Output is correct |
2 |
Correct |
63 ms |
9812 KB |
Output is correct |
3 |
Correct |
75 ms |
12336 KB |
Output is correct |
4 |
Correct |
85 ms |
14452 KB |
Output is correct |
5 |
Incorrect |
66 ms |
16900 KB |
Output isn't correct |
6 |
Incorrect |
107 ms |
19140 KB |
Output isn't correct |
7 |
Correct |
68 ms |
16880 KB |
Output is correct |
8 |
Correct |
78 ms |
16888 KB |
Output is correct |
9 |
Correct |
109 ms |
19092 KB |
Output is correct |
10 |
Correct |
97 ms |
19084 KB |
Output is correct |