結果
| 問題 |
No.23 技の選択
|
| コンテスト | |
| ユーザー |
hiroga
|
| 提出日時 | 2020-01-13 14:33:36 |
| 言語 | Kotlin (2.1.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 761 bytes |
| コンパイル時間 | 14,145 ms |
| コンパイル使用メモリ | 449,376 KB |
| 実行使用メモリ | 57,168 KB |
| 最終ジャッジ日時 | 2024-12-17 18:47:54 |
| 合計ジャッジ時間 | 23,358 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 WA * 10 |
コンパイルメッセージ
Main.kt:21:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
^
ソースコード
private const val SPECIAL_ATTACK_NUM_EXPECTED = 1.5
internal fun solve(HP: Int, normal: Int, special: Int): String {
fun attackUntilYouDie(currentHP: Double): Double {
return when {
currentHP <= 0 -> {
0.0
}
currentHP <= normal -> {
1.0
}
else -> {
SPECIAL_ATTACK_NUM_EXPECTED + attackUntilYouDie(currentHP - special)
}
}
}
return attackUntilYouDie(HP.toDouble()).toString()
}
fun main(args: Array<String>) {
var OUTPUT = ""
val br = System.`in`.bufferedReader()
val (HP, normal, special) = br.readLine().split(" ").map { it.toInt() }
OUTPUT += solve(HP, normal, special)
print(OUTPUT)
}
hiroga