結果

問題 No.512 魔法少女の追いかけっこ
ユーザー elevenstargamer
提出日時 2017-06-01 19:04:55
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,373 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 113,928 KB
実行使用メモリ 27,572 KB
最終ジャッジ日時 2024-06-27 06:32:24
合計ジャッジ時間 3,682 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 42 WA * 9 RE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pj12
{
    class Program
    {
        static void Main(string[] args)
        {
            double[] speed = Console.ReadLine().Trim().Split(' ').Select(x => double.Parse(x)).ToArray();
            double spX = speed[0] * 1000 / 3600;
            double spY = speed[1] * 1000 / 3600;

            int coner = int.Parse(Console.ReadLine());

            String look = "YES";

            int[] road = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();

            double X = spX, Y = spY;
            int posX = 0, posY = 0;
            int roadX = 0, roadY = 0;

            for(int i = 0;i < coner;i++)
            {
                    while(X >= roadX)
                    {
                        roadX += road[posX];
                        posX++;
                    }

                    while(Y >= roadY)
                    {
                        roadY += road[posY];
                        posY++;
                    }

                    if (posX + 1 < posY)
                    {
                        look = "NO";
                        break;
                    }
                    X += spX;
                    Y += spY;

            }
            Console.WriteLine(look);
        }
    }
}
0