結果

問題 No.292 芸名
ユーザー CroweaCrowea
提出日時 2019-01-24 18:41:29
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 684 bytes
コンパイル時間 777 ms
コンパイル使用メモリ 63,696 KB
実行使用メモリ 22,844 KB
最終ジャッジ日時 2023-10-14 09:41:54
合計ジャッジ時間 2,294 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,716 KB
testcase_01 AC 55 ms
22,752 KB
testcase_02 AC 55 ms
22,844 KB
testcase_03 AC 55 ms
20,824 KB
testcase_04 AC 54 ms
20,636 KB
testcase_05 AC 54 ms
22,820 KB
testcase_06 AC 54 ms
18,728 KB
testcase_07 AC 55 ms
22,844 KB
testcase_08 AC 55 ms
20,728 KB
testcase_09 AC 56 ms
22,752 KB
testcase_10 AC 54 ms
20,708 KB
testcase_11 AC 54 ms
20,796 KB
testcase_12 AC 54 ms
20,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        var input   = Console.ReadLine().Split(' ');
        var name = input[0];
        var idx_t = int.Parse(input[1]);
        var idx_u = int.Parse(input[2]);

        if (idx_t == idx_u) name = name.Remove(idx_t, 1);
        else
        {
            var chArr = name.ToCharArray();
            chArr[idx_t] = ' ';
            chArr[idx_u] = ' ';

            var sb = new StringBuilder();
            foreach (char c in chArr)
            {
                if (c != ' ') sb.Append(c);
            }
            name = sb.ToString();
        }
        Console.WriteLine(name);
    }
}
0