結果
問題 |
No.218 経験値1.5倍
|
ユーザー |
![]() |
提出日時 | 2015-06-03 11:44:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 554 bytes |
コンパイル時間 | 112 ms |
コンパイル使用メモリ | 23,040 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 13:52:57 |
合計ジャッジ時間 | 903 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d", &a); | ~~~~~^~~~~~~~~~ main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d", &b); | ~~~~~^~~~~~~~~~ main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d", &c); | ~~~~~^~~~~~~~~~
ソースコード
#include <stdio.h> int main() { int a, b, c; double normal, unnormal; double res; scanf("%d", &a); scanf("%d", &b); scanf("%d", &c); normal = (double)a / (double)b; //普段必要な素材の2/3 normal = normal * 2.0 / 3.0; unnormal = (double)a / (double)c; //キャンペーン中に必要な素材 if(normal != (int)normal) { normal = (int)normal + 1; } if(unnormal != (int)unnormal) { unnormal = (int)unnormal + 1; } res = normal * 2.0 / 3.0; if(res < unnormal){ printf("NO\n"); } else { printf("YES\n"); } return 0; }