結果

問題 No.232 めぐるはめぐる (2)
ユーザー しらゆきしらゆき
提出日時 2015-11-23 12:19:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 271 ms / 1,000 ms
コード長 1,297 bytes
コンパイル時間 2,812 ms
コンパイル使用メモリ 101,984 KB
実行使用メモリ 25,000 KB
最終ジャッジ日時 2023-10-12 13:43:22
合計ジャッジ時間 6,846 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 261 ms
25,000 KB
testcase_01 AC 262 ms
24,984 KB
testcase_02 AC 264 ms
22,932 KB
testcase_03 AC 271 ms
23,056 KB
testcase_04 AC 56 ms
18,888 KB
testcase_05 AC 57 ms
22,812 KB
testcase_06 AC 56 ms
20,752 KB
testcase_07 AC 55 ms
20,660 KB
testcase_08 AC 199 ms
20,656 KB
testcase_09 AC 56 ms
20,724 KB
testcase_10 AC 55 ms
18,788 KB
testcase_11 AC 56 ms
20,792 KB
testcase_12 AC 56 ms
22,732 KB
testcase_13 AC 56 ms
20,656 KB
testcase_14 AC 56 ms
20,740 KB
testcase_15 AC 56 ms
20,836 KB
testcase_16 AC 57 ms
20,720 KB
testcase_17 AC 56 ms
20,648 KB
testcase_18 AC 58 ms
20,768 KB
testcase_19 AC 56 ms
20,752 KB
testcase_20 AC 55 ms
20,664 KB
testcase_21 AC 55 ms
20,752 KB
testcase_22 AC 60 ms
20,792 KB
testcase_23 AC 56 ms
22,816 KB
testcase_24 AC 55 ms
22,712 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    static void Main()
    {
        var tmp = Console.ReadLine().Split();
        int t = int.Parse(tmp[0]);
        int a = int.Parse(tmp[1]);
        int b = int.Parse(tmp[2]);

        var key = new string[t];

        if (t == 1 && a == 0 && b == 0)
        {
            Console.WriteLine("NO");
            return;
        }

        if (a > t || b > t)
        {
            Console.WriteLine("NO");
            return;
        }
        else
        {
            Console.WriteLine("YES");

            for (int i = 0; i < a; i++)
            {
                key[i] += "^";
            }
            for (int i = 0; i < b; i++)
            {
                key[t - i - 1] += ">";
            }

            if (a <= t / 2)
            {
                for (int i = a; i < t - 1; i += 2)
                {
                    key[i] += "^";
                    key[i + 1] += "v";
                }
            }
            if (b <= t / 2)
            {
                for (int i = b; i < t - 1; i += 2)
                {
                    key[t - i - 1] += ">";
                    key[t - i - 2] += "<";
                }
            }
        }

        for (int i = 0; i < t; i++)
        {
            Console.WriteLine(key[i]);
        }
    }
}
0