結果

問題 No.26 シャッフルゲーム
ユーザー バカらっくバカらっく
提出日時 2019-09-04 18:42:00
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 305 ms / 5,000 ms
コード長 384 bytes
コンパイル時間 14,178 ms
コンパイル使用メモリ 414,588 KB
実行使用メモリ 54,828 KB
最終ジャッジ日時 2023-08-28 13:12:53
合計ジャッジ時間 18,572 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 289 ms
52,760 KB
testcase_01 AC 289 ms
52,828 KB
testcase_02 AC 305 ms
52,968 KB
testcase_03 AC 291 ms
54,828 KB
testcase_04 AC 294 ms
52,996 KB
testcase_05 AC 305 ms
52,888 KB
testcase_06 AC 301 ms
53,040 KB
testcase_07 AC 298 ms
52,936 KB
testcase_08 AC 304 ms
52,876 KB
testcase_09 AC 305 ms
52,852 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:2:10: warning: parameter 'arr' is never used
fun main(arr:Array<String>) {
         ^

ソースコード

diff #

fun main(arr:Array<String>) {
    val initialPos = readLine()!!.toInt()
    val inputCount = readLine()!!.toInt()
    var currentPos = initialPos
    (1..inputCount).forEach {
        val rep = readLine()!!.split(" ").map { it.toInt() }
        if(rep.contains(currentPos)) {
            currentPos = rep.filter { it != currentPos }.first()
        }
    }
    println(currentPos)
}
0