# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1189322 | prideliqueee | Spiderman (COCI20_spiderman) | C++20 | 1349 ms | 11632 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,k;
cin>>n>>k;
int ans[1000010];
memset(ans,0,sizeof ans);
int a[n];
for(int i=0;i<n;i++)
{
int x;
cin>>x;
a[i]=x;
if(x>=k)
ans[k]++;
for(int j=1;j*x+k<=1000000;j++)
ans[x*j+k]++;
}
for(int i=0;i<n;i++)
{
if(k==0||a[i]%k==0)
cout<<ans[a[i]]-1;
else
cout<<ans[a[i]];
cout<<' ';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |