# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1017197 | vjudge1 | Spiderman (COCI20_spiderman) | C++17 | 85 ms | 10188 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 = 3e5 + 10, A = 1e6 + 10;
int n, k, a[N], cnt[A], ans[A];
int main(){
cin >> n >> k;
for (int i = 0; i < n; i ++)
cin >> a[i], cnt[a[i]]++;
for (int i = 0; i < n; i ++){
if (cnt[a[i]] == 0 or k >= a[i]) continue;
for (int r = k; r <= 1e6; r += a[i])
ans[r] += cnt[a[i]];
cnt[a[i]] = 0;
}
for (int i = 0; i < n; i ++)
cout << ans[a[i]] << " ";
cout << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |