結果

問題 No.512 魔法少女の追いかけっこ
ユーザー focus
提出日時 2018-02-15 13:57:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 53,736 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-27 06:51:19
合計ジャッジ時間 1,665 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d",&num);
      |     ~~~~~^~~~~~~~~~~
main.cpp:11:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |             scanf("%d",&num);
      |             ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    int X,Y,N,num,sum=0;
    cin >> X >> Y >> N;
    scanf("%d",&num);
    sum+=num;
    for(int i=1;i<N;i++){
            scanf("%d",&num);
            if( (sum+num)*X < sum*Y){
                cout << "NO\n"; 
                return 0;
            }
            sum+=num;
    }
    cout << "YES\n";
    return 0;
}
0