結果

問題 No.218 経験値1.5倍
ユーザー Yatsuku
提出日時 2015-12-24 02:06:28
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 20,096 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-18 22:32:19
合計ジャッジ時間 988 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%d", &a);
      |         ^~~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d", &b);
      |         ^~~~~~~~~~~~~~~
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%d", &c);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void)
{
	int a;
	int b;
	int c;

	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);

	int normal = 1;
	while ( 1 ) {
		b *= normal;
		normal++;
		if ( b == a ) {
			break;
		}
		if ( b > a ) {
			break;
		}
	}

	int bonus = 1;
	while ( 1 ) {
		c *= bonus;
		bonus++;
		if ( c == a ) {
			break;
		}
		if ( c > a ) {
			break;
		}
	}

	if ( (double)((bonus - 1) / (normal - 1)) <= (double)(2 / 3) ) {
		puts("YES");
	} else {
		puts("NO");
	}
	return 0;
}
0