# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
701156 | rinho | Spiderman (COCI20_spiderman) | C++14 | 152 ms | 12400 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;
int n, k, a[1000000], ans[1000000], maxx = -1e9;
map<int, int> cnt;
void in(){
cin >> n >> k;
for(int i = 1; i <= n; i++) {
cin >> a[i];
cnt[a[i]]++;
maxx = max(maxx, a[i]);
}
}
void solve(){
for(auto i : cnt){
if(i.first <= k) continue;
for(int j = k; j <= maxx; j += i.first){
ans[j] += i.second;
}
}
for(int i = 1; i <= n; i++) cout << ans[a[i]] << ' ';
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
t = 1;
while(t--){
in();
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |