답안 #635139

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
635139 2022-08-25T14:02:00 Z PanTkd Zalmoxis (BOI18_zalmoxis) C++14
0 / 100
138 ms 12500 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{
			x=a[i];
		}
	}

	for(ll i=0;i<n;i++){
		if(x==a[i])
			cout<<a[i]<<' ';
		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 130 ms 12368 KB Expected EOF
2 Incorrect 124 ms 12220 KB Expected EOF
3 Incorrect 122 ms 12240 KB Expected EOF
4 Incorrect 120 ms 12368 KB Expected EOF
5 Incorrect 123 ms 12500 KB Expected EOF
6 Incorrect 115 ms 12232 KB Expected EOF
# 결과 실행 시간 메모리 Grader output
1 Incorrect 124 ms 12276 KB Expected EOF
2 Incorrect 117 ms 12200 KB Expected EOF
3 Incorrect 129 ms 12224 KB Expected EOF
4 Incorrect 122 ms 12364 KB Expected EOF
5 Incorrect 138 ms 12360 KB Expected EOF
6 Incorrect 115 ms 12240 KB Unexpected end of file - int32 expected
7 Incorrect 131 ms 12348 KB Expected EOF
8 Incorrect 125 ms 12476 KB Expected EOF
9 Incorrect 102 ms 9908 KB Unexpected end of file - int32 expected
10 Incorrect 37 ms 3936 KB Unexpected end of file - int32 expected
11 Incorrect 72 ms 6280 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