結果

問題 No.729 文字swap
ユーザー neko_the_shadowneko_the_shadow
提出日時 2018-12-02 15:58:50
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 936 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 8,311 ms
コンパイル使用メモリ 253,516 KB
実行使用メモリ 62,412 KB
最終ジャッジ日時 2023-09-13 20:51:21
合計ジャッジ時間 22,852 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 901 ms
62,412 KB
testcase_01 AC 927 ms
62,300 KB
testcase_02 AC 921 ms
62,316 KB
testcase_03 AC 914 ms
62,216 KB
testcase_04 AC 905 ms
62,188 KB
testcase_05 AC 908 ms
62,092 KB
testcase_06 AC 933 ms
62,108 KB
testcase_07 AC 916 ms
62,364 KB
testcase_08 AC 922 ms
62,224 KB
testcase_09 AC 923 ms
62,004 KB
testcase_10 AC 934 ms
62,152 KB
testcase_11 AC 917 ms
62,144 KB
testcase_12 AC 936 ms
62,068 KB
testcase_13 AC 933 ms
62,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

object Q729 {
  def main(args: Array[String]) = {
    val chars = io.StdIn.readLine().toSeq
    val indexes = io.StdIn.readLine().split(' ').map(_.toInt).toSeq

    val i = indexes(0)
    val j = indexes(1)
    val answer = chars.updated(i, chars(j)).updated(j, chars(i)).mkString("")
    println(answer)
  }
}
0