結果

問題 No.232 めぐるはめぐる (2)
ユーザー nokonokonokonoko
提出日時 2015-06-29 23:40:35
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 2,014 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 101,616 KB
実行使用メモリ 22,944 KB
最終ジャッジ日時 2023-09-22 04:32:25
合計ジャッジ時間 6,546 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 252 ms
22,892 KB
testcase_01 AC 255 ms
22,844 KB
testcase_02 AC 256 ms
22,892 KB
testcase_03 AC 251 ms
20,772 KB
testcase_04 AC 55 ms
22,756 KB
testcase_05 AC 55 ms
20,712 KB
testcase_06 AC 56 ms
22,908 KB
testcase_07 AC 55 ms
22,916 KB
testcase_08 AC 201 ms
22,852 KB
testcase_09 AC 54 ms
20,804 KB
testcase_10 AC 56 ms
22,944 KB
testcase_11 WA -
testcase_12 AC 56 ms
20,764 KB
testcase_13 WA -
testcase_14 AC 55 ms
20,808 KB
testcase_15 AC 56 ms
20,844 KB
testcase_16 AC 54 ms
20,816 KB
testcase_17 AC 57 ms
20,744 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 58 ms
22,848 KB
testcase_22 AC 56 ms
18,808 KB
testcase_23 AC 55 ms
22,788 KB
testcase_24 AC 55 ms
20,812 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(">");
                    }
                    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