結果

問題 No.512 魔法少女の追いかけっこ
コンテスト
ユーザー monburan_0401
提出日時 2018-10-04 13:49:39
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 619 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 175 ms
コンパイル使用メモリ 40,296 KB
最終ジャッジ日時 2026-02-22 01:56:36
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <math.h>
int main(void){
    double X,Y;     //  Va,Vb [km/h]
    int N;          //  number of intersection
    int A[80];      //  length of each intersection
    int i;          //  subscript
    double t;       //  time A arrive at A[i]

    scanf("%lf %lf %d",&X,&Y,&N);
    for(i = 0; i < N; i++){
        scanf("%d",&A[i]);
    }

    //  km/h -> m/s
    X /= 3.6;
    Y /= 3.6;

    for(i = 0; i < N - 1; i++){
        //  t = (double)A[i] / X;
        if(A[i] * Y > A[i+1] * X){
            printf("NO\n");
            return 0;
        }
    }

    printf("YES\n");
    return 0;
}
0