#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
signed main(){
int n,k;
cin>>n>>k;
vector <int> a(n);
map <int,int> mp;
for(int i=0;i<n;i++){
cin>>a[i];
mp[a[i]]++;
}
int val=-1,ins=-1;
for(auto x: mp){
if(x.ss==2){
if(mp[x.ff+1]==0){
val=x.ff+1;
ins=x.ff;
break;
}
}
}
for(int i=0;i<n;i++){
if(a[i]==ins && val!=-1){
cout<<val<<" "<<a[i]<<" ";
val=-1;
}
else{
cout<<a[i]<<" ";
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
189 ms |
7516 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
190 ms |
7508 KB |
not a zalsequence |
3 |
Incorrect |
204 ms |
7788 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
182 ms |
7880 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
205 ms |
7884 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
233 ms |
7584 KB |
not a zalsequence |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
191 ms |
7684 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
176 ms |
7644 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
184 ms |
7936 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
178 ms |
7760 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
177 ms |
7764 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
177 ms |
7508 KB |
Unexpected end of file - int32 expected |
7 |
Incorrect |
182 ms |
7760 KB |
Unexpected end of file - int32 expected |
8 |
Incorrect |
185 ms |
8016 KB |
Unexpected end of file - int32 expected |
9 |
Incorrect |
143 ms |
6488 KB |
Unexpected end of file - int32 expected |
10 |
Incorrect |
54 ms |
2644 KB |
Unexpected end of file - int32 expected |
11 |
Incorrect |
90 ms |
4180 KB |
Unexpected end of file - int32 expected |
12 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
13 |
Incorrect |
0 ms |
344 KB |
Unexpected end of file - int32 expected |
14 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |