結果

問題 No.232 めぐるはめぐる (2)
ユーザー nokonokonokonoko
提出日時 2015-06-29 23:20:43
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,936 bytes
コンパイル時間 3,082 ms
コンパイル使用メモリ 103,948 KB
実行使用メモリ 24,936 KB
最終ジャッジ日時 2023-09-22 04:30:41
合計ジャッジ時間 9,418 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 61 ms
22,860 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 58 ms
22,904 KB
testcase_08 WA -
testcase_09 AC 59 ms
20,896 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 58 ms
20,764 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace YukiCoderNo232
{
    class Program
    {
        static void Main()
        {
            string[] buffer = (Console.ReadLine()).Split(' ');
            int turn = int.Parse(buffer[0]);
            int posY = int.Parse(buffer[1]);
            int posX = int.Parse(buffer[2]);
            int posMax = Math.Max(posX, posY);

            if (turn >= posMax)
            {
                Console.WriteLine("YES");
                int step = turn - posMax;
                int dummyStepCount = (step / 2);
                for (int i = 0; i <= dummyStepCount; i++)
                {
                    Console.WriteLine(">");
                    Console.WriteLine("<");
                }
                int posMin = Math.Min(posX, posY);
                int posDiff = Math.Abs(posY - posX);
                if ((step % 2) == 0)
                {
                    for (int i = 0; i < posMin; i++)
                    {
                        Console.WriteLine("^>");
                    }
                }
                else
                {
                    Console.WriteLine("^");
                    Console.WriteLine(">");
                    for (int i = 1; i < posMin; i++)
                    {
                        Console.WriteLine("^>");
                    }
                }
                if (posX > posY)
                {
                    for (int i = 0; i < posDiff; i++)
                    {
                        Console.WriteLine(">");
                    }
                }
                else if (posX < posY)
                {
                    {
                        for (int i = 0; i < posDiff; i++)
                        {
                            Console.WriteLine("^");
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}
0