結果
| 問題 | 
                            No.2015 Stair Counter
                             | 
                    
| コンテスト | |
| ユーザー | 
                             pengin_2000
                         | 
                    
| 提出日時 | 2022-08-21 13:57:21 | 
| 言語 | C  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 436 bytes | 
| コンパイル時間 | 320 ms | 
| コンパイル使用メモリ | 29,952 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-10-10 06:09:23 | 
| 合計ジャッジ時間 | 2,253 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 8 WA * 17 | 
ソースコード
#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;
}
            
            
            
        
            
pengin_2000