# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
634134 | BidoTeima | Spiderman (COCI20_spiderman) | C++17 | 176 ms | 17948 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.
/// isA AC
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void ACPLS()
{
#ifndef ONLINE_JUDGE
freopen("output.txt", "w", stdout);
freopen("input.txt", "r", stdin);
#endif
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
void moo(string fileName){
freopen((fileName+".in").c_str(),"r",stdin);
freopen((fileName+".out").c_str(),"w",stdout);
}
#define tc \
int tttttt,subtask; \
cin >> tttttt /*>> subtask*/; \
while (tttttt--)
#define sumrange(l, r, arr) (l == 0 ? arr[r] : arr[r] - arr[l - 1])
#define all(v) v.begin(), v.end()
ll f[(int)1e6+5], ans[(int)1e6+5];
int main()
{
//ACPLS();
int n,k;
cin>>n>>k;
int a[n];
for(int&i:a)cin>>i, f[i]++;
for(int i = k + 1; i <= 1e6; i++){
for(int j = k; j <= 1e6; j += i){
ans[j] += f[i];
}
}
for(int i : a)cout<<(ans[i]-(k==0))<<' ';
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |