#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tN, tK;
cin >> tN >> tK;
list<int> remain;
vector<int> sorted(tN);
vector<int> rsorted(tK);
for(int id=0; id<tN; ++id)
{
int tmp;
cin >> tmp;
sorted[id] = tmp;
remain.push_back(tmp);
}
sort(sorted.rbegin(), sorted.rend());
for(int id=0; id< tK;++id)
{
remain.remove(sorted[id]);
rsorted[id] = sorted[id];
}
sort(rsorted.begin(), rsorted.end());
for(auto it = remain.begin(); it != remain.end(); ++it)
{
cout << *it << " ";
}
for(int id=0; id<tK;++id)
{
cout << rsorted[id] << " ";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
164 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |
2 |
Incorrect |
102 ms |
2528 KB |
Output isn't correct |