結果

問題 No.365 ジェンガソート
ユーザー ldsyb
提出日時 2016-04-29 23:40:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 248 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 63,192 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 19:20:34
合計ジャッジ時間 1,702 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
	int ans = 0,n;
	cin >> n;
	int a[2] = {};
	for(int i = 0;i < n;i++){
		cin >> a[i & 1];
		if(a[i & 1] == n && i != n - 1){
			cout << --n << endl;
			return 0;
		}
	}
	cout << --a[0] << endl;
}
0