結果

問題 No.1628 Sorting Integers (MAX of M)
ユーザー 👑 箱
提出日時 2021-07-30 21:01:59
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 718 bytes
コンパイル時間 16,504 ms
コンパイル使用メモリ 425,728 KB
実行使用メモリ 54,668 KB
最終ジャッジ日時 2023-10-14 01:48:13
合計ジャッジ時間 20,688 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 298 ms
53,044 KB
testcase_01 AC 288 ms
53,032 KB
testcase_02 AC 291 ms
53,264 KB
testcase_03 AC 292 ms
52,832 KB
testcase_04 AC 287 ms
53,052 KB
testcase_05 AC 287 ms
52,736 KB
testcase_06 AC 285 ms
54,668 KB
testcase_07 AC 288 ms
53,044 KB
testcase_08 AC 284 ms
52,768 KB
testcase_09 AC 288 ms
52,928 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:9: warning: variable 'n' is never used
    val n = nextInt()
        ^

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val n = nextInt()
    val c = Array(9) { nextInt() }
    for (i in 8 downTo 0) {
        print(('1' + i).toString().repeat(c[i]))
    }
    println()
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve()
    writer.flush()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
// endregion
0