답안 #635140

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
635140 2022-08-25T14:06:32 Z PanTkd Zalmoxis (BOI18_zalmoxis) C++14
0 / 100
131 ms 10244 KB
//
//  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<<' ';
		}
		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 131 ms 10192 KB not a zalsequence
2 Incorrect 115 ms 10204 KB not a zalsequence
3 Incorrect 114 ms 10244 KB not a zalsequence
4 Incorrect 119 ms 10188 KB Unexpected end of file - int32 expected
5 Incorrect 118 ms 10204 KB not a zalsequence
6 Incorrect 123 ms 10216 KB not a zalsequence
# 결과 실행 시간 메모리 Grader output
1 Incorrect 115 ms 10212 KB Unexpected end of file - int32 expected
2 Incorrect 113 ms 10120 KB Unexpected end of file - int32 expected
3 Incorrect 116 ms 10172 KB Unexpected end of file - int32 expected
4 Incorrect 114 ms 10200 KB Unexpected end of file - int32 expected
5 Incorrect 121 ms 10240 KB Unexpected end of file - int32 expected
6 Incorrect 112 ms 10144 KB Unexpected end of file - int32 expected
7 Incorrect 119 ms 10124 KB Unexpected end of file - int32 expected
8 Incorrect 114 ms 10184 KB Unexpected end of file - int32 expected
9 Incorrect 93 ms 8148 KB Unexpected end of file - int32 expected
10 Incorrect 34 ms 3232 KB Unexpected end of file - int32 expected
11 Incorrect 58 ms 5268 KB Unexpected end of file - int32 expected
12 Incorrect 1 ms 212 KB Unexpected end of file - int32 expected
13 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
14 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected