結果

問題 No.501 穴と文字列
ユーザー masaktmasakt
提出日時 2017-04-07 23:37:38
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 754 bytes
コンパイル時間 2,372 ms
コンパイル使用メモリ 104,584 KB
実行使用メモリ 22,760 KB
最終ジャッジ日時 2023-08-21 07:12:29
合計ジャッジ時間 4,700 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
22,720 KB
testcase_01 AC 57 ms
22,576 KB
testcase_02 AC 55 ms
20,760 KB
testcase_03 AC 56 ms
20,692 KB
testcase_04 AC 56 ms
20,720 KB
testcase_05 AC 55 ms
20,572 KB
testcase_06 AC 55 ms
20,724 KB
testcase_07 AC 56 ms
20,708 KB
testcase_08 AC 56 ms
20,580 KB
testcase_09 AC 56 ms
22,760 KB
testcase_10 AC 57 ms
20,588 KB
testcase_11 AC 55 ms
20,736 KB
testcase_12 AC 55 ms
18,736 KB
testcase_13 AC 56 ms
22,712 KB
testcase_14 AC 56 ms
18,632 KB
testcase_15 AC 58 ms
20,812 KB
testcase_16 AC 58 ms
20,728 KB
testcase_17 AC 58 ms
20,692 KB
testcase_18 AC 59 ms
22,644 KB
testcase_19 AC 59 ms
22,628 KB
testcase_20 AC 57 ms
20,620 KB
testcase_21 AC 58 ms
20,644 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class P
{
    static void Main(string[] _)
    {
        _ = Console.ReadLine().Split(' ');
        int N = int.Parse(_[0]);
        int D = int.Parse(_[1]);
        int b = D - N;
        int c = N - D;
        StringBuilder r = new StringBuilder();
        for (int i = 0; i < N; i++)
        {
            r.Append("A");
        }

        if (b > 0)
        {
            for (int i = N - 1; i >= N - b; i--)
            {
                r[i] = 'B';
            }
        }
        else if (c > 0)
        {
            for (int i = N - 1; i >= N - c; i--)
            {
                r[i] = 'C';
            }
        }


        Console.WriteLine(r);
    }
}
0