//
// main.cpp
//
// Created by Panagiotis Chadjicostas on
// Copyright © Panagiotis Hadjicostas. All rights reserved.
//
#include <iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <cstring>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
#define fo(i,a,b) for(int i = a; i<=b; i++)
#define f(i,b) for(int i=0;i<b;i++)
#define F first
#define S second
#define sz size
#define ls s,m,idx<<1
#define rs m+1,e,idx<<1|1
#ifdef panas
#define p(x) cerr<<#x<<x<<endl;
#else
#define p(x) {}
#endif
const ll MOD=ll(1e9)+7;
const ll MAXN=2*ll(1e6);
void checker(){
ll n=rand()%20+2;
vi a(n,ll());
for(ll i=0;i<n;i++){
a[i]=rand()%20+2;
}
for(ll b=0;b<(1<<n);b++){
vi on,off;
for(ll i=0;i<n;i++){
if(i&(1<<i)){
on.push_back(i);
}
else{
off.push_back(i);
}
}
}
}
///////////////////////////////////////////////////////////////////////
void solve(){
ll n,k;cin>>n>>k;
vector<ll> a(n,ll());
map<ll,ll> mp;
for(ll i=0;i<n;i++){cin>>a[i];mp[a[i]]++;}
ll x=0;
for(ll i=1;i<=29;i++){
if(mp[i]==2)
mp[i+1]++;
else if (mp[i]==1){
x=i;
break;
}
}
bool f=0;
for(ll i=0;i<n;i++){
if(x-1==a[i]&&!f){
f=1;
cout<<x<<' ';
}else if(x==29-n+1&&a[i]==x&&!f){
f=1;
cout<<x<<' ';
}
cout<<a[i]<<' ';
}
return ;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t=1;//cin>>t;
while (t--) {
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
111 ms |
10188 KB |
not a zalsequence |
2 |
Incorrect |
119 ms |
10136 KB |
not a zalsequence |
3 |
Incorrect |
120 ms |
10192 KB |
not a zalsequence |
4 |
Incorrect |
120 ms |
10184 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
112 ms |
10204 KB |
not a zalsequence |
6 |
Incorrect |
120 ms |
10188 KB |
not a zalsequence |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
116 ms |
10144 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
117 ms |
10184 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
121 ms |
10196 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
125 ms |
10132 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
125 ms |
10232 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
117 ms |
10188 KB |
Unexpected end of file - int32 expected |
7 |
Incorrect |
114 ms |
10184 KB |
Unexpected end of file - int32 expected |
8 |
Incorrect |
123 ms |
10188 KB |
Unexpected end of file - int32 expected |
9 |
Incorrect |
94 ms |
8184 KB |
Unexpected end of file - int32 expected |
10 |
Incorrect |
37 ms |
3180 KB |
Unexpected end of file - int32 expected |
11 |
Incorrect |
59 ms |
5192 KB |
Unexpected end of file - int32 expected |
12 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
13 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
14 |
Incorrect |
1 ms |
212 KB |
Unexpected end of file - int32 expected |