#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 2;
int cnt[N], ans[N];
int main()
{
int n, k;
cin >> n >> k;
vector<int> v(n);
for(int i = 0; i < n; i ++)
{
cin >> v[i];
cnt[v[i]]++;
}
for(int i = k + 1; i < N; i++)
for(int j = k; j < N; j += i)
ans[j] += cnt[i];
for(int x : v)
cout << ans[x] << ' ';
cout << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
6492 KB |
Output is correct |
2 |
Correct |
16 ms |
5720 KB |
Output is correct |
3 |
Correct |
38 ms |
7772 KB |
Output is correct |
4 |
Correct |
81 ms |
10556 KB |
Output is correct |
5 |
Incorrect |
50 ms |
9300 KB |
Output isn't correct |
6 |
Incorrect |
87 ms |
12108 KB |
Output isn't correct |
7 |
Correct |
36 ms |
9476 KB |
Output is correct |
8 |
Correct |
41 ms |
9300 KB |
Output is correct |
9 |
Correct |
89 ms |
12112 KB |
Output is correct |
10 |
Correct |
97 ms |
12112 KB |
Output is correct |