Submission #199880

# Submission time Handle Problem Language Result Execution time Memory
199880 2020-02-03T22:33:47 Z milagrosvilla1803 Spiderman (COCI20_spiderman) C++11
0 / 70
93 ms 15224 KB
#include <bits/stdc++.h>
using namespace std;
int alturas1[300005];
int alturas2[300005];
int cubeta[1000005];
int n,k,aux=0;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n>>k;
    for(int i=0;i<n;i++){
        cin>>alturas1[i];
        alturas2[i]=alturas1[i];
    }
    sort(alturas2,alturas2+n);
    int maximo=alturas2[n-1];
    for(int i=0;i<n;i++){
        if(alturas2[i]==alturas2[i-1] || k>=alturas2[i]) continue;
        int mult=0, result=1;
        while(result<maximo){
            result=alturas2[i]*mult+k;
            cubeta[result]++;
            mult++;
        }
    }
    for(int i=0;i<n;i++){
        cout<<cubeta[alturas1[i]]<<" ";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 18 ms 11000 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 18 ms 10104 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 37 ms 12280 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 68 ms 15008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 55 ms 13944 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 93 ms 14968 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 44 ms 13816 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 46 ms 13816 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 87 ms 15120 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 88 ms 15224 KB Execution killed with signal 11 (could be triggered by violating memory limits)