結果

問題 No.1765 While Shining
ユーザー forest3forest3
提出日時 2021-11-30 00:51:53
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 329 bytes
コンパイル時間 2,056 ms
コンパイル使用メモリ 164,684 KB
実行使用メモリ 10,512 KB
最終ジャッジ日時 2023-09-15 10:38:20
合計ジャッジ時間 7,434 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 20 ms
4,376 KB
testcase_10 AC 30 ms
4,376 KB
testcase_11 AC 26 ms
4,376 KB
testcase_12 AC 28 ms
4,380 KB
testcase_13 AC 25 ms
4,376 KB
testcase_14 AC 31 ms
4,376 KB
testcase_15 AC 31 ms
4,380 KB
testcase_16 AC 31 ms
4,380 KB
testcase_17 AC 31 ms
4,380 KB
testcase_18 AC 31 ms
4,376 KB
testcase_19 AC 31 ms
4,376 KB
testcase_20 AC 31 ms
4,380 KB
testcase_21 AC 31 ms
4,500 KB
testcase_22 AC 31 ms
4,380 KB
testcase_23 AC 31 ms
4,380 KB
testcase_24 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
	int N;
	cin >> N;
	vector<int> A( N );
	for( int i = 0; i < N; i++ ) cin >> A[i];

	int ans = 0;
	for( int i = 0; i < N; i++ ) {
		int f = 0;
		for( int j = i; j < N - 1; j++ ) {
			if( (f ^ A[j]) == 0 ) break;
			ans++;
			f = 1 - f;
		}
	}

	cout << ans << endl;
}

0