結果

問題 No.512 魔法少女の追いかけっこ
ユーザー ooh_21
提出日時 2017-06-01 18:02:00
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,696 bytes
コンパイル時間 860 ms
コンパイル使用メモリ 111,960 KB
実行使用メモリ 27,256 KB
最終ジャッジ日時 2024-06-27 06:32:08
合計ジャッジ時間 3,788 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 37 WA * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
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)
        {
            int[] speed = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
            speed[0] = speed[0] * 1000 / 60 / 60;
            speed[1] = speed[1] * 1000 / 60 / 60;

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

            String look = "YES";



            int[] road = new int[coner];
            int[] line = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
            
            for(int i = 0;i < coner;i++)
            {
                road[i] = line[i];
            }

            int nowX = 0, nowY = 0;

            for(int i = 0;i < coner;i++)
            {
                for (int j = 0; j < coner;j++ )
                {
                    if(speed[0] <= 0)
                    {
                        nowX = j;
                    }
                    else
                    {
                        speed[0] -= road[j];
                    }

                    if (speed[1] <= 0)
                    {
                        nowY = j;
                    }
                    else
                    {
                        speed[1] -= road[j];
                    }

                    if(nowX - nowY > 1)
                    {
                        look = "NO";
                        break;
                    }
                }
                speed[0] += speed[0];
                speed[1] += speed[1];

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