結果

問題 No.451 575
ユーザー Naoyk1212
提出日時 2016-12-02 00:29:48
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 500 bytes
コンパイル時間 1,406 ms
コンパイル使用メモリ 161,004 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-16 07:43:58
合計ジャッジ時間 10,837 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

vector<long long> vect;
vector<long long> ans;
int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		long long a;
		cin >> a;
		vect.push_back(a);
	}
	
	bool ok = true;
	for(int i = 0; i < n; i++){
		if(i % 2 == 0 && i == vect.size() - 1){
			if(vect[i] < vect[i + 1])ok = false;
		}
	}
	
	if(ok == false)cout << "-1" << endl;
	else{
		cout << n + 1 << endl;
		for(int i = 0; i < n; i++){
			cout << vect[i] << endl;
		}
		cout << 1 << endl;
	}
}
0