# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1092747 | Hacv16 | Spiderman (COCI20_spiderman) | C++17 | 58 ms | 12128 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 10;
int n, k, v[MAX];
int resp[MAX], freq[MAX];
int32_t main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> k;
for(int i = 1; i <= n; i++)
{
cin >> v[i];
freq[ v[i] ]++;
}
for(int i = 1; i < MAX; i++)
for(int j = 0; j * i + k < MAX; j++)
if(k < i) resp[j * i + k] += freq[i];
for(int i = 1; i <= n; i++)
cout << resp[ v[i] ] << ' ';
cout << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |