Submission #384852

# Submission time Handle Problem Language Result Execution time Memory
384852 2021-04-02T13:04:36 Z fadi57 Spiderman (COCI20_spiderman) C++14
0 / 70
1349 ms 6436 KB
#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 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