# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744539 | vjudge1 | Spiderman (COCI20_spiderman) | C++17 | 209 ms | 19136 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;
#define int long long
#define mid (start+end)/2
#define OYY 1000005
#define ordu ios_base::sync_with_stdio(false);cin.tie(NULL);
map <int,int> mp;
int as[OYY];
int32_t main(){
ordu
int t=1;//cin>>t;
while(t--){
mp.clear();
int n,k;cin>>n>>k;
int dizi[n];
for(int i=0;i<n;i++){
cin>>dizi[i];
mp[dizi[i]]++;
}
map <int,int> ::iterator it=mp.begin();
while(it!=mp.end()){
if(it->first<=k){
it++;
continue;
}
for(int j=k;j<OYY;j+=it->first){
as[j]+=it->second;
}
if(k==0)as[it->first]--;
//cout<<"Lost in japan"<<endl;;
it++;
}
for(int i=0;i<n;i++){
cout<<as[dizi[i]]<<" ";
}
cout<<'\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |