結果

問題 No.512 魔法少女の追いかけっこ
ユーザー pengin_2000
提出日時 2020-02-21 02:10:27
言語 C
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 295 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 24,960 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-13 13:47:13
合計ジャッジ時間 2,047 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d %d", &x, &y);
      |         ^~~~~~~~~~~~~~~~~~~~~~
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~
main.c:11:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                 scanf("%d", &a[i + 1]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main()
{
	int x, y;
	scanf("%d %d", &x, &y);
	int n;
	scanf("%d", &n);
	int i;
	int a[88];
	for (i = 0; i < n; i++)
		scanf("%d", &a[i + 1]);
	for (i = 0; i < n; i++)
	{
		if (y * a[i] > x* a[i + 1])
		{
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	return 0;
}
0