結果

問題 No.71 そろばん
ユーザー バカらっくバカらっく
提出日時 2019-09-23 10:30:09
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 311 ms / 5,000 ms
コード長 326 bytes
コンパイル時間 13,877 ms
コンパイル使用メモリ 433,900 KB
実行使用メモリ 51,872 KB
最終ジャッジ日時 2023-10-19 07:56:32
合計ジャッジ時間 20,856 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 291 ms
51,768 KB
testcase_01 AC 292 ms
51,780 KB
testcase_02 AC 306 ms
51,872 KB
testcase_03 AC 305 ms
51,872 KB
testcase_04 AC 304 ms
51,868 KB
testcase_05 AC 305 ms
51,872 KB
testcase_06 AC 309 ms
51,872 KB
testcase_07 AC 311 ms
51,864 KB
testcase_08 AC 300 ms
51,868 KB
testcase_09 AC 300 ms
51,860 KB
testcase_10 AC 303 ms
51,868 KB
testcase_11 AC 300 ms
51,864 KB
testcase_12 AC 300 ms
51,872 KB
testcase_13 AC 305 ms
51,860 KB
testcase_14 AC 301 ms
51,868 KB
testcase_15 AC 307 ms
51,872 KB
testcase_16 AC 298 ms
51,852 KB
testcase_17 AC 302 ms
51,860 KB
testcase_18 AC 302 ms
51,868 KB
testcase_19 AC 310 ms
51,868 KB
testcase_20 AC 302 ms
51,864 KB
testcase_21 AC 300 ms
51,872 KB
testcase_22 AC 302 ms
51,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'arr' is never used
fun main(arr:Array<String>) {
         ^

ソースコード

diff #

fun main(arr:Array<String>) {
    val ballCount = readLine()!!.toLong()
    var max = 0.toLong()
    for(i in (2..ballCount)) {
        if(i > ballCount) {
            break
        }
        var big = ballCount - (i - 1)
        val ans = big * i + (ballCount - big)
        max = Math.max(max, ans)
    }
    println(max)
}
0