結果

問題 No.512 魔法少女の追いかけっこ
ユーザー AQUA16573837
提出日時 2018-04-06 02:04:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 60,224 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 06:57:45
合計ジャッジ時間 1,727 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 52 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘void solve()’:
main.cpp:21:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |         scanf("%d %d %d", &x, &y, &n);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:23:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   23 |                 scanf("%d", A + i);
      |                 ~~~~~^~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <iostream>
using namespace std;
using ll = long long;

void solve();
int main() {
	solve();
#ifdef DBG
	while (true);
#endif
}

//512
void solve() {
	int x, y, n, A[80];
	scanf("%d %d %d", &x, &y, &n);
	for (int i = 0; i < n; i++)
		scanf("%d", A + i);
	bool lost = false;
	for (int i = 1; i < (n - 1); i++)
		if (A[i + 1] < (A[i] * y + x - 1) / x)
			lost = true;
	printf("%s\n", lost ? "NO" : "YES");
}
0