結果

問題 No.512 魔法少女の追いかけっこ
ユーザー umaumax
提出日時 2017-05-05 22:30:22
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 57,056 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 05:52:49
合計ジャッジ時間 1,796 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cfloat>
#include <iostream>

using namespace std;

int main(int argc, const char* argv[])
{
	int X, Y, N;
	cin >> X >> Y >> N;
	int A[N];
	for (auto&& a : A) cin >> a;
	int V   = Y - X;
	int sum = 0;
	int i   = 0;
	for (auto&& a : A) {
		double ty = (double)(sum + a) / Y;
		if (sum > ty * X - DBL_MIN) {
			cout << "NO" << endl;
			return 0;
		}
		sum += a;
	}
	cout << "YES" << endl;
	return 0;
}
0