#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n, k, x;
vector<pair<int, int>> v, v2;
vector<int> nums[N], vec;
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
cin >> n >> k;
for(int i = 0; i < n; i++){
cin >> x;
nums[i].push_back(x);
v.push_back({x, i});
}
for(int num = 1; num <= 29; num++){
swap(v, v2);
v.clear();
for(auto p : v2){
if(v.empty()) v.push_back(p);
else{
if(v.back().first == num){
if(p.first == num){
v.back().first = num + 1;
v.back().second = p.second;
}
else{
v.back().first = num + 1;
nums[v.back().second].push_back(num);
v.push_back(p);
}
}
else v.push_back(p);
}
}
if(v.back().first == num){
v.back().first = num + 1;
nums[v.back().second].push_back(num);
}
}
for(int i = 0; i < n; i++){
for(auto j : nums[i]){
vec.push_back(j);
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
304 ms |
95764 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
310 ms |
90236 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
297 ms |
95168 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
309 ms |
90776 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
304 ms |
90564 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
324 ms |
96460 KB |
Unexpected end of file - int32 expected |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
358 ms |
95404 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
330 ms |
96244 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
288 ms |
90240 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
294 ms |
90196 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
328 ms |
90700 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
310 ms |
95420 KB |
Unexpected end of file - int32 expected |
7 |
Incorrect |
294 ms |
90468 KB |
Unexpected end of file - int32 expected |
8 |
Incorrect |
303 ms |
89856 KB |
Unexpected end of file - int32 expected |
9 |
Incorrect |
308 ms |
80680 KB |
Unexpected end of file - int32 expected |
10 |
Incorrect |
110 ms |
47320 KB |
Unexpected end of file - int32 expected |
11 |
Incorrect |
191 ms |
61208 KB |
Unexpected end of file - int32 expected |
12 |
Incorrect |
14 ms |
23764 KB |
Unexpected end of file - int32 expected |
13 |
Incorrect |
16 ms |
23764 KB |
Unexpected end of file - int32 expected |
14 |
Incorrect |
16 ms |
23748 KB |
Unexpected end of file - int32 expected |