#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<<" ";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
86 ms |
2284 KB |
Output isn't correct |
2 |
Incorrect |
79 ms |
1644 KB |
Output isn't correct |
3 |
Execution timed out |
2076 ms |
3488 KB |
Time limit exceeded |
4 |
Execution timed out |
2079 ms |
5036 KB |
Time limit exceeded |
5 |
Execution timed out |
2082 ms |
10476 KB |
Time limit exceeded |
6 |
Execution timed out |
2057 ms |
11476 KB |
Time limit exceeded |
7 |
Execution timed out |
2092 ms |
11628 KB |
Time limit exceeded |
8 |
Execution timed out |
2065 ms |
11544 KB |
Time limit exceeded |
9 |
Execution timed out |
2063 ms |
12440 KB |
Time limit exceeded |
10 |
Execution timed out |
2081 ms |
12268 KB |
Time limit exceeded |