#include<bits/stdc++.h>
using namespace std;
const int mx=60;
int n,l,r,k;
typedef long long ll;
ll a[mx];
int arr[1000008];
int main(){
int n,k;cin>>n>>k;
int h[n];
for(int i=0;i<n;i++){
cin>>h[i];
arr[h[i]]++;
}
for(int i=0;i<n;i++){
int ans=0;ans+=arr[h[i]];
if(ans){ans--;}
for(int j=2;j*j<=h[i];j++){
if(h[i]%j==0){
ans+=arr[j];
}
if((h[i]/j)!=j){
ans+=arr[h[i]/j];
}
}
cout<<ans<<" ";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
2668 KB |
Output isn't correct |
2 |
Incorrect |
9 ms |
1772 KB |
Output isn't correct |
3 |
Incorrect |
367 ms |
3692 KB |
Output isn't correct |
4 |
Incorrect |
1062 ms |
5352 KB |
Output isn't correct |
5 |
Incorrect |
426 ms |
4972 KB |
Output isn't correct |
6 |
Incorrect |
1221 ms |
6932 KB |
Output isn't correct |
7 |
Incorrect |
478 ms |
5308 KB |
Output isn't correct |
8 |
Incorrect |
483 ms |
4988 KB |
Output isn't correct |
9 |
Incorrect |
1398 ms |
7184 KB |
Output isn't correct |
10 |
Incorrect |
1440 ms |
6964 KB |
Output isn't correct |