結果

問題 No.232 めぐるはめぐる (2)
ユーザー nokonokonokonoko
提出日時 2015-06-29 23:51:01
言語 C#(csc)
(csc 3.9.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 2,504 bytes
コンパイル時間 2,126 ms
コンパイル使用メモリ 104,984 KB
実行使用メモリ 25,056 KB
最終ジャッジ日時 2023-09-22 04:34:02
合計ジャッジ時間 7,216 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 239 ms
22,796 KB
testcase_01 AC 237 ms
20,836 KB
testcase_02 AC 243 ms
20,800 KB
testcase_03 AC 248 ms
20,776 KB
testcase_04 AC 59 ms
20,788 KB
testcase_05 AC 60 ms
22,760 KB
testcase_06 AC 58 ms
22,868 KB
testcase_07 AC 59 ms
20,780 KB
testcase_08 AC 184 ms
18,804 KB
testcase_09 AC 58 ms
20,756 KB
testcase_10 AC 62 ms
20,716 KB
testcase_11 AC 59 ms
20,768 KB
testcase_12 AC 58 ms
18,760 KB
testcase_13 WA -
testcase_14 AC 59 ms
20,748 KB
testcase_15 AC 58 ms
20,740 KB
testcase_16 AC 59 ms
20,788 KB
testcase_17 AC 59 ms
22,744 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 57 ms
18,880 KB
testcase_22 AC 59 ms
22,892 KB
testcase_23 AC 58 ms
22,780 KB
testcase_24 AC 58 ms
20,688 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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) && (!((posX == 0) && (posY == 0) && (turn == 1))))
            {
                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
                {
                    if (posMin > 0)
                    {
                        Console.WriteLine("^");
                        Console.WriteLine(">");
                    }
                    else
                    {
                        if (posX > posY)
                        {
                            Console.WriteLine("^");
                            Console.WriteLine("v>");
                        }
                        else
                        {
                            Console.WriteLine(">");
                            Console.WriteLine("<^");
                        }
                        posDiff = 0;
                    }
                    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