#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<<" ";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
2668 KB |
Output isn't correct |
2 |
Incorrect |
9 ms |
1772 KB |
Output isn't correct |
3 |
Incorrect |
362 ms |
3564 KB |
Output isn't correct |
4 |
Incorrect |
1047 ms |
5228 KB |
Output isn't correct |
5 |
Incorrect |
419 ms |
4952 KB |
Output isn't correct |
6 |
Incorrect |
1183 ms |
6380 KB |
Output isn't correct |
7 |
Incorrect |
456 ms |
4844 KB |
Output isn't correct |
8 |
Incorrect |
456 ms |
4940 KB |
Output isn't correct |
9 |
Incorrect |
1345 ms |
6436 KB |
Output isn't correct |
10 |
Incorrect |
1349 ms |
6380 KB |
Output isn't correct |