結果

問題 No.127 門松もどき
ユーザー chiwakii
提出日時 2015-01-14 00:21:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 715 ms
コンパイル使用メモリ 64,228 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-22 11:11:56
合計ジャッジ時間 1,309 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main(void)
{
	int n; cin >> n;
	vector <int> a;
	for(int i=0; i<n; i++)
	{
		int temp;cin >> temp;
		a.push_back(temp);
	}
	int c1=0,c2 = 0;

	for(int i=0; a[i]>a[n-i-1];i++) c1++;
	for(int i=0; a[i]<a[n-i-1];i++) c2++;

	cout << max(c1,c2)*2 << endl;
	return 0;
}
0