結果

問題 No.512 魔法少女の追いかけっこ
ユーザー Risen
提出日時 2017-06-01 23:50:59
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 754 bytes
コンパイル時間 812 ms
コンパイル使用メモリ 114,200 KB
実行使用メモリ 26,892 KB
最終ジャッジ日時 2024-06-27 06:33:02
合計ジャッジ時間 3,485 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 53
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

class Solution
{
    static void Main(string[] args)
    {
        var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int x = vals[0];
        int y = vals[1];

        int n = int.Parse(Console.ReadLine());
        var a = new int[n];
        for (int i = 0; i < n; i++)
        {
            a[i] = int.Parse(Console.ReadLine());
        }

        bool lost = false;
        for (int i = 1; i < n; i++)
        {
            a[i] += a[i - 1];

            var xPos = a[i - 1];
            var t = xPos / x;
            var yPos = y * t;

            if (yPos > a[i])
            {
                lost = true;
            }
        }

        Console.WriteLine(lost ? "YES" : "No");
    }
}
0