結果

問題 No.365 ジェンガソート
ユーザー ldsybldsyb
提出日時 2016-04-29 23:40:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 248 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 65,408 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 06:06:03
合計ジャッジ時間 2,085 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,944 KB
testcase_02 WA -
testcase_03 AC 2 ms
6,944 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
6,940 KB
testcase_11 WA -
testcase_12 AC 2 ms
6,944 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 4 ms
6,944 KB
testcase_22 AC 6 ms
6,940 KB
testcase_23 AC 6 ms
6,940 KB
testcase_24 AC 6 ms
6,940 KB
testcase_25 AC 4 ms
6,940 KB
testcase_26 WA -
testcase_27 AC 19 ms
6,944 KB
testcase_28 AC 6 ms
6,940 KB
testcase_29 AC 10 ms
6,944 KB
testcase_30 AC 3 ms
6,940 KB
testcase_31 AC 3 ms
6,940 KB
testcase_32 AC 6 ms
6,940 KB
testcase_33 AC 18 ms
6,940 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 2 ms
6,940 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

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