結果

問題 No.232 めぐるはめぐる (2)
ユーザー nokonokonokonoko
提出日時 2015-07-01 00:29:27
言語 C#(csc)
(csc 3.9.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 2,364 bytes
コンパイル時間 2,271 ms
コンパイル使用メモリ 102,048 KB
実行使用メモリ 24,744 KB
最終ジャッジ日時 2023-09-22 04:47:27
合計ジャッジ時間 8,970 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 614 ms
20,804 KB
testcase_01 AC 619 ms
20,848 KB
testcase_02 AC 619 ms
20,880 KB
testcase_03 AC 630 ms
18,840 KB
testcase_04 AC 59 ms
20,684 KB
testcase_05 AC 59 ms
20,696 KB
testcase_06 AC 59 ms
20,788 KB
testcase_07 AC 58 ms
20,588 KB
testcase_08 AC 452 ms
20,664 KB
testcase_09 AC 57 ms
22,700 KB
testcase_10 AC 59 ms
20,656 KB
testcase_11 AC 58 ms
22,720 KB
testcase_12 AC 59 ms
20,788 KB
testcase_13 AC 58 ms
18,764 KB
testcase_14 AC 58 ms
20,828 KB
testcase_15 AC 59 ms
22,748 KB
testcase_16 AC 58 ms
20,640 KB
testcase_17 WA -
testcase_18 AC 63 ms
20,656 KB
testcase_19 AC 58 ms
20,756 KB
testcase_20 AC 58 ms
20,704 KB
testcase_21 AC 59 ms
20,744 KB
testcase_22 AC 58 ms
22,708 KB
testcase_23 AC 57 ms
22,704 KB
testcase_24 AC 58 ms
20,700 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) && (!((posMax == 0) && (turn == 1))))
            {
                Console.WriteLine("YES");
                int dummyStepTurnX = turn - posX;
                int dummyStepTurnY = turn - posY;
                int[] stepListX = new int[turn];
                int[] stepListY = new int[turn];

                for (int i = 0, dummyX = (dummyStepTurnX - (dummyStepTurnX % 2)); i < dummyX; i++)
                {
                    stepListX[i] = ((i % 2) << 1) - 1;
                }
                for (int i = dummyStepTurnX; i < turn; i++)
                {
                    stepListX[i] = 1;
                }
                for (int i = 0, dummyY = (dummyStepTurnY - (dummyStepTurnY % 2)); i < dummyY; i++)
                {
                    stepListY[i] = ((i % 2) << 1) - 1;
                }
                for (int i = dummyStepTurnY; i < turn; i++)
                {
                    stepListY[i] = 1;
                }
                if ((dummyStepTurnX % 2) != 0)
                {
                    int stepBuffer = stepListX[0];
                    stepListX[0] = stepListX[dummyStepTurnX - 1];
                    stepListX[dummyStepTurnX - 1] = stepBuffer;
                }
                for (int i = 0; i < turn; i++)
                {

                    if (stepListX[i] == 1)
                    {
                        Console.Write(">");
                    }
                    else if (stepListX[i] == -1)
                    {
                        Console.Write("<");
                    }
                    if (stepListY[i] == 1)
                    {
                        Console.Write("^");
                    }
                    else if (stepListY[i] == -1)
                    {
                        Console.Write("v");
                    }
                    Console.WriteLine();
                }
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}
0