#include <iostream>
using namespace std;
#define int long long
int v[2000001];
int ciur[2000001];
int frv[2000001];
signed main()
{
int n,i,j,k,cnt=0;
cin>>n>>k;
for(i=1;i<=n;i++){
cin>>v[i];
if(v[i]>k){cnt++;
frv[v[i]]++;
}
}
for(i=1;i<=2e6;i++){
if(frv[i]){
for(j=0;j<=2e6;j+=i){
ciur[j+k]+=frv[i];
}
}
}
for(i=1;i<=n;i++){
cout<<ciur[v[i]]<<" ";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
20 ms |
19032 KB |
Output isn't correct |
2 |
Incorrect |
22 ms |
17756 KB |
Output isn't correct |
3 |
Correct |
53 ms |
20752 KB |
Output is correct |
4 |
Incorrect |
90 ms |
23284 KB |
Output isn't correct |
5 |
Incorrect |
75 ms |
25424 KB |
Output isn't correct |
6 |
Incorrect |
124 ms |
28476 KB |
Output isn't correct |
7 |
Incorrect |
63 ms |
25424 KB |
Output isn't correct |
8 |
Incorrect |
69 ms |
25380 KB |
Output isn't correct |
9 |
Correct |
123 ms |
28284 KB |
Output is correct |
10 |
Incorrect |
129 ms |
28240 KB |
Output isn't correct |