Submission #1316432

#TimeUsernameProblemLanguageResultExecution timeMemory
1316432ninstroyerSpiderman (COCI20_spiderman)C++20
14 / 70
2095 ms1616 KiB
#include<bits/stdc++.h>
using namespace std;

const int nx = 3e5+5, hx = 1e6+5;

int n, k, arr[nx], cnt[nx];

int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
    cin>>n>>k;
    for(int i = 1; i <= n; i++) cin>>arr[i];
    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= n; j++)
        {
            if(i==j) continue;
            if(arr[i]%arr[j] == k) cnt[i]++;
        }
    }
    for(int i = 1; i <= n; i++) cout<<cnt[i]<<" ";
}
#Verdict Execution timeMemoryGrader output
Fetching results...