# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
384850 | fadi57 | Spiderman (COCI20_spiderman) | C++14 | 2092 ms | 12440 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 mx=60;
int n,l,r,k;
typedef long long ll;
ll a[mx];
int main(){
int n,k;cin>>n>>k;
map<int,int>mp;
int h[n];
for(int i=0;i<n;i++){
cin>>h[i];
mp[h[i]]++;
}
for(int i=0;i<n;i++){
int ans=0;ans+=mp[h[i]];
if(ans){ans--;}
for(int j=2;j*j<=h[i];j++){
if(h[i]%j==0){
ans+=mp[j];
}
if((h[i]/j)!=j){
ans+=mp[h[i]/j];
}
}
cout<<ans<<" ";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |