結果

問題 No.729 文字swap
ユーザー neko_the_shadowneko_the_shadow
提出日時 2018-12-02 16:06:23
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 934 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 8,691 ms
コンパイル使用メモリ 257,976 KB
実行使用メモリ 62,260 KB
最終ジャッジ日時 2023-09-13 20:52:02
合計ジャッジ時間 22,652 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 931 ms
62,100 KB
testcase_01 AC 919 ms
61,980 KB
testcase_02 AC 926 ms
62,196 KB
testcase_03 AC 918 ms
62,120 KB
testcase_04 AC 915 ms
62,084 KB
testcase_05 AC 934 ms
61,960 KB
testcase_06 AC 922 ms
61,928 KB
testcase_07 AC 928 ms
62,060 KB
testcase_08 AC 918 ms
62,044 KB
testcase_09 AC 906 ms
61,964 KB
testcase_10 AC 914 ms
61,980 KB
testcase_11 AC 918 ms
61,836 KB
testcase_12 AC 930 ms
62,260 KB
testcase_13 AC 926 ms
61,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    val i = indexes(0)
    val j = indexes(1)
    val answer = word.updated(i, word(j)).updated(j, word(i))
    println(answer)
  }
}
0