結果

問題 No.5017 Tool-assisted Shooting
ユーザー エセ賢者エセ賢者
提出日時 2023-07-16 14:38:36
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 450 ms / 2,000 ms
コード長 1,231 bytes
コンパイル時間 12,477 ms
コンパイル使用メモリ 425,796 KB
実行使用メモリ 69,592 KB
スコア 74,830
平均クエリ数 399.74
最終ジャッジ日時 2023-07-16 14:39:34
合計ジャッジ時間 52,684 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 316 ms
66,376 KB
testcase_01 AC 426 ms
68,588 KB
testcase_02 AC 318 ms
66,984 KB
testcase_03 AC 320 ms
66,268 KB
testcase_04 AC 347 ms
68,912 KB
testcase_05 AC 354 ms
69,420 KB
testcase_06 AC 307 ms
66,312 KB
testcase_07 AC 337 ms
68,600 KB
testcase_08 AC 337 ms
67,164 KB
testcase_09 AC 320 ms
68,296 KB
testcase_10 AC 354 ms
68,272 KB
testcase_11 AC 313 ms
68,740 KB
testcase_12 AC 313 ms
66,152 KB
testcase_13 AC 324 ms
68,808 KB
testcase_14 AC 327 ms
68,192 KB
testcase_15 AC 334 ms
66,296 KB
testcase_16 AC 304 ms
66,796 KB
testcase_17 AC 408 ms
69,092 KB
testcase_18 AC 433 ms
68,580 KB
testcase_19 AC 321 ms
68,664 KB
testcase_20 AC 328 ms
68,324 KB
testcase_21 AC 366 ms
68,456 KB
testcase_22 AC 360 ms
68,340 KB
testcase_23 AC 313 ms
66,300 KB
testcase_24 AC 346 ms
69,012 KB
testcase_25 AC 344 ms
68,548 KB
testcase_26 AC 359 ms
68,988 KB
testcase_27 AC 417 ms
68,740 KB
testcase_28 AC 344 ms
68,632 KB
testcase_29 AC 328 ms
68,172 KB
testcase_30 AC 351 ms
68,420 KB
testcase_31 AC 337 ms
66,400 KB
testcase_32 AC 317 ms
68,372 KB
testcase_33 AC 324 ms
68,580 KB
testcase_34 AC 436 ms
68,784 KB
testcase_35 AC 309 ms
68,356 KB
testcase_36 AC 355 ms
69,220 KB
testcase_37 AC 337 ms
68,828 KB
testcase_38 AC 336 ms
66,212 KB
testcase_39 AC 409 ms
68,928 KB
testcase_40 AC 349 ms
68,704 KB
testcase_41 AC 330 ms
66,104 KB
testcase_42 AC 374 ms
69,076 KB
testcase_43 AC 387 ms
68,892 KB
testcase_44 AC 335 ms
66,796 KB
testcase_45 AC 314 ms
68,408 KB
testcase_46 AC 409 ms
68,704 KB
testcase_47 AC 361 ms
68,948 KB
testcase_48 AC 416 ms
69,008 KB
testcase_49 AC 434 ms
68,680 KB
testcase_50 AC 363 ms
68,524 KB
testcase_51 AC 415 ms
69,180 KB
testcase_52 AC 418 ms
68,704 KB
testcase_53 AC 359 ms
68,752 KB
testcase_54 AC 322 ms
68,208 KB
testcase_55 AC 358 ms
68,544 KB
testcase_56 AC 308 ms
66,312 KB
testcase_57 AC 422 ms
68,816 KB
testcase_58 AC 392 ms
68,852 KB
testcase_59 AC 319 ms
68,488 KB
testcase_60 AC 382 ms
69,592 KB
testcase_61 AC 418 ms
68,568 KB
testcase_62 AC 441 ms
68,480 KB
testcase_63 AC 328 ms
69,096 KB
testcase_64 AC 314 ms
66,164 KB
testcase_65 AC 450 ms
69,208 KB
testcase_66 AC 344 ms
68,380 KB
testcase_67 AC 325 ms
68,388 KB
testcase_68 AC 345 ms
68,932 KB
testcase_69 AC 361 ms
68,728 KB
testcase_70 AC 306 ms
66,380 KB
testcase_71 AC 350 ms
68,964 KB
testcase_72 AC 334 ms
66,312 KB
testcase_73 AC 418 ms
68,604 KB
testcase_74 AC 320 ms
68,956 KB
testcase_75 AC 354 ms
68,844 KB
testcase_76 AC 348 ms
68,648 KB
testcase_77 AC 320 ms
68,728 KB
testcase_78 AC 350 ms
68,244 KB
testcase_79 AC 372 ms
68,860 KB
testcase_80 AC 340 ms
69,040 KB
testcase_81 AC 348 ms
69,108 KB
testcase_82 AC 350 ms
69,156 KB
testcase_83 AC 329 ms
68,404 KB
testcase_84 AC 310 ms
68,748 KB
testcase_85 AC 327 ms
66,580 KB
testcase_86 AC 335 ms
68,500 KB
testcase_87 AC 315 ms
66,772 KB
testcase_88 AC 323 ms
66,440 KB
testcase_89 AC 334 ms
68,524 KB
testcase_90 AC 330 ms
68,844 KB
testcase_91 AC 321 ms
66,804 KB
testcase_92 AC 431 ms
69,376 KB
testcase_93 AC 309 ms
66,732 KB
testcase_94 AC 328 ms
68,896 KB
testcase_95 AC 446 ms
68,612 KB
testcase_96 AC 421 ms
68,988 KB
testcase_97 AC 305 ms
66,184 KB
testcase_98 AC 339 ms
66,448 KB
testcase_99 AC 332 ms
68,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:10:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:28:40: warning: 'toInt(): Int' is deprecated. Conversion of Char to Number is deprecated. Use Char.code property instead.
            enemyList.add(Enemy(hpx[2].toInt(), 59, hpx[0].toInt(), hpx[1].toInt()))
                                       ^
Main.kt:28:60: warning: 'toInt(): Int' is deprecated. Conversion of Char to Number is deprecated. Use Char.code property instead.
            enemyList.add(Enemy(hpx[2].toInt(), 59, hpx[0].toInt(), hpx[1].toInt()))
                                                           ^
Main.kt:28:76: warning: 'toInt(): Int' is deprecated. Conversion of Char to Number is deprecated. Use Char.code property instead.
            enemyList.add(Enemy(hpx[2].toInt(), 59, hpx[0].toInt(), hpx[1].toInt()))
                                                                           ^

ソースコード

diff #

private fun next() = readLine()!!
private fun nextInt() = next().toInt()
private fun nextLong() = next().toLong()
private fun nextDouble() = next().toDouble()
private fun nextList() = next().split(" ")
private fun nextIntList() = next().split(" ").map { it.toInt() }.toIntArray()
private fun nextLongList() = next().split(" ").map { it.toLong() }.toLongArray()
private fun nextDoubleList() = next().split(" ").map { it.toDouble() }.toDoubleArray()

fun main(args: Array<String>) {
    var turn = 0
    var enemyList = mutableListOf<Enemy>()
    while (turn < 1000) {
        val n = nextInt()
        if (n == -1) {
            return
        }
        val newEnemyList = mutableListOf<Enemy>()
        for (enemy in enemyList) {
            val isAlive = enemy.nextTurn()
            if (isAlive) {
                newEnemyList.add(enemy)
            }
        }
        enemyList = newEnemyList
        for (i in 0 until n) {
            val hpx = next()
            enemyList.add(Enemy(hpx[2].toInt(), 59, hpx[0].toInt(), hpx[1].toInt()))
        }
        println("S")
        turn++
    }
}

class Enemy(var x: Int, var y: Int, var h: Int, var p: Int) {
    fun nextTurn(): Boolean {
        y--
        return y >= 0
    }
}
0