結果

問題 No.729 文字swap
ユーザー バカらっくバカらっく
提出日時 2018-09-07 21:55:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 1,170 bytes
コンパイル時間 1,447 ms
コンパイル使用メモリ 70,088 KB
実行使用メモリ 24,052 KB
最終ジャッジ日時 2023-08-19 18:23:01
合計ジャッジ時間 3,284 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
23,968 KB
testcase_01 AC 66 ms
22,016 KB
testcase_02 AC 66 ms
21,920 KB
testcase_03 AC 65 ms
21,888 KB
testcase_04 AC 66 ms
19,796 KB
testcase_05 AC 67 ms
23,996 KB
testcase_06 AC 66 ms
21,820 KB
testcase_07 AC 66 ms
22,060 KB
testcase_08 AC 65 ms
21,972 KB
testcase_09 AC 66 ms
21,864 KB
testcase_10 AC 66 ms
19,908 KB
testcase_11 AC 66 ms
24,052 KB
testcase_12 AC 66 ms
19,960 KB
testcase_13 AC 64 ms
19,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Program
{

    public void Proc()
    {
        char[] inpt = Reader.ReadLine().ToArray();
        int[] idx = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();

        char tmp = inpt[idx[0]];
        inpt[idx[0]] = inpt[idx[1]];
        inpt[idx[1]] = tmp;
        Console.WriteLine(string.Join("", inpt));
    
    }

    public class Reader
    {
        static StringReader sr;
        public static bool IsDebug = false;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (sr == null)
                {
                    sr = new StringReader(InputText.Trim());
                }
                return sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        private static string InputText = @"





yukicoder
6 2





";
    }

    public static void Main(string[] args)
    {
#if DEBUG
        Reader.IsDebug = true;
#endif
        Program prg = new Program();
        prg.Proc();
    }
}
0