結果
| 問題 | 
                            No.1736 Princess vs. Dragoness
                             | 
                    
| コンテスト | |
| ユーザー | 
                             pengin_2000
                         | 
                    
| 提出日時 | 2021-11-18 23:21:32 | 
| 言語 | C  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 709 bytes | 
| コンパイル時間 | 1,459 ms | 
| コンパイル使用メモリ | 29,696 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-27 22:37:55 | 
| 合計ジャッジ時間 | 2,936 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 WA * 8 | 
ソースコード
#include<stdio.h>
int main()
{
	long long int n, a, b, x, y;
	scanf("%lld %lld %lld %lld %lld", &n, &a, &b, &x, &y);
	long long int i;
	long long int h[3003];
	for (i = 0; i < n; i++)
		scanf("%lld", &h[i]);
	for (i = 0; i < n; i++)
	{
		if (h[i] / x <= a)
		{
			a -= h[i] / x;
			h[i] %= x;
		}
		else
		{
			h[i] -= x * a;
			a = 0;
		}
	}
	for (i = 0; i < n - 1; i++)
	{
		if (h[i] < h[i + 1])
		{
			h[i] ^= h[i + 1];
			h[i + 1] ^= h[i];
			h[i] ^= h[i + 1];
			if (i > 0)
				i -= 2;
		}
	}
	for (i = 0; i < n; i++)
	{
		if (a > 0)
		{
			a--;
			h[i] -= x;
		}
	}
	long long int sum = 0;
	for (i = 0; i < n; i++)
		sum += h[i];
	if (sum > b * y)
		printf("No\n");
	else
		printf("Yes\n");
	return 0;
}
            
            
            
        
            
pengin_2000