Submission #384853

# Submission time Handle Problem Language Result Execution time Memory
384853 2021-04-02T13:10:46 Z fadi57 Spiderman (COCI20_spiderman) C++14
0 / 70
1388 ms 6508 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--;}
    //cout<<ans<<" ";
    for(int j=2;j*j<=h[i];j++){
        if(h[i]%j==0){
             //   cout<<h[i]<<" "<<j<<" ";
            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 354 ms 3596 KB Output isn't correct
4 Incorrect 1036 ms 5264 KB Output isn't correct
5 Incorrect 408 ms 4972 KB Output isn't correct
6 Incorrect 1187 ms 6476 KB Output isn't correct
7 Incorrect 456 ms 4972 KB Output isn't correct
8 Incorrect 453 ms 4844 KB Output isn't correct
9 Incorrect 1388 ms 6508 KB Output isn't correct
10 Incorrect 1384 ms 6252 KB Output isn't correct