結果

問題 No.1990 Candy Boxes
ユーザー 👑 ygussanyygussany
提出日時 2022-06-24 22:12:12
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 568 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 30,208 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-30 18:05:36
合計ジャッジ時間 5,834 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
13,756 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 0 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 15 ms
6,940 KB
testcase_13 AC 15 ms
6,940 KB
testcase_14 AC 12 ms
6,940 KB
testcase_15 AC 13 ms
6,940 KB
testcase_16 AC 14 ms
6,940 KB
testcase_17 AC 15 ms
6,944 KB
testcase_18 AC 15 ms
6,940 KB
testcase_19 AC 16 ms
6,944 KB
testcase_20 AC 18 ms
6,940 KB
testcase_21 AC 17 ms
6,940 KB
testcase_22 AC 13 ms
6,940 KB
testcase_23 AC 18 ms
6,940 KB
testcase_24 AC 17 ms
6,944 KB
testcase_25 AC 24 ms
6,940 KB
testcase_26 AC 15 ms
6,940 KB
testcase_27 AC 16 ms
6,944 KB
testcase_28 AC 17 ms
6,944 KB
testcase_29 AC 16 ms
6,940 KB
testcase_30 AC 13 ms
6,940 KB
testcase_31 AC 16 ms
6,940 KB
testcase_32 AC 9 ms
6,940 KB
testcase_33 AC 13 ms
6,944 KB
testcase_34 AC 1,026 ms
6,940 KB
testcase_35 TLE -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main()
{
	int i, N, B[200001];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(B[i]));
	
	int j;
	for (i = 1; i <= N; i++) {
		if (B[i] == 0) continue;
		if (i == N) break;
		if (B[i] % 2 != B[i+1] % 2) {
			for (j = i + 1; j < N; j++) if (B[j] % 2 == B[j+1] % 2) break;
			if (j == N) break;
			for (; j > i; j--) {
				if (B[j] == 0 || B[j+1] == 0) break;
				B[j]--;
				B[j+1]--;
			}
		}
		if (B[i] > B[i+1]) break;
		B[i+1] -= B[i];
		B[i] = 0;
	}
	if (i > N) printf("Yes\n");
	else printf("No\n");
	fflush(stdout);
	return 0;
}
0