結果
| 問題 |
No.1628 Sorting Integers (MAX of M)
|
| コンテスト | |
| ユーザー |
バカらっく
|
| 提出日時 | 2022-02-03 12:23:56 |
| 言語 | Kotlin (2.1.0) |
| 結果 |
AC
|
| 実行時間 | 297 ms / 2,000 ms |
| コード長 | 431 bytes |
| コンパイル時間 | 10,230 ms |
| コンパイル使用メモリ | 436,600 KB |
| 実行使用メモリ | 52,276 KB |
| 最終ジャッジ日時 | 2024-06-11 09:47:16 |
| 合計ジャッジ時間 | 13,924 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 |
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
^
Main.kt:4:9: warning: variable 'n' is never used
val n = readLine()!!.toInt()
^
ソースコード
import java.lang.StringBuilder
fun main(args: Array<String>) {
val n = readLine()!!.toInt()
val c = readLine()!!.split(" ").map { it.toInt() }
var ans = ""
c.indices.reversed().forEach { idx ->
c[idx].let { cnt ->
if(cnt > 0) {
(idx+1).toString()[0].let { num ->
ans += "".padStart(cnt, num)
}
}
}
}
println(ans)
}
バカらっく