#include <bits/stdc++.h>
#define fast cin.tie(0)->sync_with_stdio(0);
#define int long long
#define inf ((int)1e18)
#define N 1000005
using namespace std;
vector <int> cnt(N), ans(N), values, arr(N);
int32_t main(){
fast
int n, k;
cin>>n>>k;
for(int i = 0; i < n; i++) {
cin>>arr[i];
int in = arr[i];
if(!cnt[in]) {
values.push_back(in);
}
cnt[in]++;
}
sort(values.begin(), values.end());
reverse(values.begin(), values.end());
//k kalanını unutma
for(auto val:values) {
//cout<<val<<":\n";
if(k == 0) {
ans[val] += cnt[val] - 1;
}s
if(k >= val) continue;
for(int i = 0; i <= values[0] - k; i += val) {
ans[i + k] += cnt[val];
}
}
for(int i = 0; i < n; i++) {
cout<<ans[arr[i]]<<" ";
}
}
Compilation message
spiderman.cpp: In function 'int32_t main()':
spiderman.cpp:28:4: error: 's' was not declared in this scope
28 | }s
| ^