結果

問題 No.2015 Stair Counter
ユーザー pengin_2000pengin_2000
提出日時 2022-08-21 13:57:21
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 436 bytes
コンパイル時間 1,341 ms
コンパイル使用メモリ 30,464 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-18 12:56:31
合計ジャッジ時間 3,377 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,816 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 11 ms
6,944 KB
testcase_14 AC 11 ms
6,940 KB
testcase_15 AC 12 ms
6,940 KB
testcase_16 AC 20 ms
6,944 KB
testcase_17 AC 13 ms
6,944 KB
testcase_18 AC 16 ms
6,944 KB
testcase_19 AC 21 ms
6,940 KB
testcase_20 AC 15 ms
6,944 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int a[200005];
int main()
{
	int t;
	scanf("%d", &t);
	int n, m;
	int i, f;
	for (; t > 0; t--)
	{
		scanf("%d %d", &n, &m);
		a[0] = m;
		for (i = 0; i < n; i++)
			scanf("%d", &a[i + 1]);
		f = 0;
		for (i = 0; i < n - 1; i++)
			if (a[i] > a[i + 1] + a[i + 2])
				f++;
		for (i = 2; i <= n; i++)
			if (a[i] > a[i - 1] + a[i - 2])
				f++;
		if (f > 0)
			printf("No\n");
		else
			printf("Yes\n");
	}
	return 0;
}
0