結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
rutilicus
|
| 提出日時 | 2020-08-30 21:23:29 |
| 言語 | Kotlin (2.1.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 347 bytes |
| コンパイル時間 | 8,941 ms |
| コンパイル使用メモリ | 410,304 KB |
| 最終ジャッジ日時 | 2025-03-31 02:16:28 |
| 合計ジャッジ時間 | 9,723 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
Main.kt:12:13: error: 'fun StringBuilder.appendln(value: Int): StringBuilder' is deprecated. Use appendLine instead. Note that the new method always appends the line feed character '\n' regardless of the system line separator.
builder.appendln(max(rem, -1))
^^^^^^^^
ソースコード
import kotlin.math.max
fun main() {
val builder = StringBuilder()
val (k, n, _) = readInputLine().split(" ").map { it.toInt() }
var rem = k * n
readInputLine().split(" ").forEach { rem -= it.toInt() }
builder.appendln(max(rem, -1))
print(builder.toString())
}
fun readInputLine(): String {
return readLine()!!
}
rutilicus