# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1017193 | vjudge1 | Spiderman (COCI20_spiderman) | C++17 | 97 ms | 10144 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 N = 1e6 + 2;
int cnt[N], ans[N];
int main()
{
int n, k;
cin >> n >> k;
vector<int> v(n);
for(int i = 0; i < n; i ++)
{
cin >> v[i];
cnt[v[i]]++;
}
for(int i = k + 1; i < N; i++)
for(int j = k; j < N; j += i)
ans[j] += cnt[i];
for(int x : v)
{
cout << ans[x] - (k == 0) << ' ';
}
cout << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |