Submission #105439

# Submission time Handle Problem Language Result Execution time Memory
105439 2019-04-12T10:48:04 Z igzi Karte (COCI18_karte) C++17
0 / 120
94 ms 2540 KB
#include <bits/stdc++.h>

using namespace::std;

int n,k,i,x;
vector <int> v;

bool proveri(){
int br=0;
for(i=v.size()-1;i>=0;i--){
    if(v[i]>br) br++;
}
return br!=k;
}

int main(){
std::ios_base::sync_with_stdio(0);
cin>>n>>k;
for(i=0;i<n;i++){
    cin>>x;
    v.push_back(x);
}
sort(v.begin(),v.end());
reverse(v.end()-k,v.end());
if(!proveri()) cout<<-1<<endl;
else{
    for(i=0;i<n;i++) cout<<v[i]<<" ";
}
return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 1016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 1532 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 94 ms 2540 KB Output isn't correct
2 Halted 0 ms 0 KB -