Submission #1645737


Source Code Expand

#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N;
	cin >> N;
	vector<int> A(N,INF);
	for(int i=0;i<N-1;++i){
		int a;
		cin >> a;
		int L = i;
		int R = i+1;
		if( A[L] > a ){
			A[L] = a;
		}
		if( A[R] > a ){
			A[R] = a;
		}
	}
	for(int i=0;i<N;++i){
		if(i)cout << " ";
		cout << A[i];
	}
	cout << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Submission Info

Submission Time
Task B - 積み鉛筆
User akarin55
Language C++14 (GCC 5.4.1)
Score 80
Code Size 1603 Byte
Status AC
Exec Time 19 ms
Memory 1536 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 80 / 80
Status
AC × 3
AC × 18
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt
All sample1.txt, sample2.txt, sample3.txt, subtask0_0.txt, subtask0_1.txt, subtask0_10.txt, subtask0_11.txt, subtask0_12.txt, subtask0_13.txt, subtask0_14.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt, subtask0_5.txt, subtask0_6.txt, subtask0_7.txt, subtask0_8.txt, subtask0_9.txt
Case Name Status Exec Time Memory
sample1.txt AC 1 ms 256 KB
sample2.txt AC 1 ms 256 KB
sample3.txt AC 1 ms 256 KB
subtask0_0.txt AC 18 ms 1408 KB
subtask0_1.txt AC 16 ms 1152 KB
subtask0_10.txt AC 15 ms 1152 KB
subtask0_11.txt AC 17 ms 1280 KB
subtask0_12.txt AC 17 ms 1408 KB
subtask0_13.txt AC 16 ms 1152 KB
subtask0_14.txt AC 17 ms 1280 KB
subtask0_2.txt AC 14 ms 1152 KB
subtask0_3.txt AC 17 ms 1408 KB
subtask0_4.txt AC 16 ms 1152 KB
subtask0_5.txt AC 14 ms 1152 KB
subtask0_6.txt AC 17 ms 1408 KB
subtask0_7.txt AC 13 ms 1024 KB
subtask0_8.txt AC 16 ms 1280 KB
subtask0_9.txt AC 19 ms 1536 KB