結果

問題 No.313 π
ユーザー yudedakoyudedako
提出日時 2020-08-27 11:49:05
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 401 ms / 5,000 ms
コード長 491 bytes
コンパイル時間 11,377 ms
コンパイル使用メモリ 436,724 KB
実行使用メモリ 54,488 KB
最終ジャッジ日時 2024-04-25 05:33:37
合計ジャッジ時間 26,839 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 374 ms
54,104 KB
testcase_01 AC 394 ms
54,016 KB
testcase_02 AC 401 ms
54,364 KB
testcase_03 AC 388 ms
54,164 KB
testcase_04 AC 388 ms
54,456 KB
testcase_05 AC 374 ms
54,472 KB
testcase_06 AC 370 ms
54,244 KB
testcase_07 AC 371 ms
54,348 KB
testcase_08 AC 382 ms
54,412 KB
testcase_09 AC 372 ms
54,332 KB
testcase_10 AC 374 ms
54,276 KB
testcase_11 AC 380 ms
54,156 KB
testcase_12 AC 382 ms
54,104 KB
testcase_13 AC 378 ms
54,320 KB
testcase_14 AC 375 ms
54,448 KB
testcase_15 AC 381 ms
54,184 KB
testcase_16 AC 380 ms
54,488 KB
testcase_17 AC 374 ms
54,392 KB
testcase_18 AC 371 ms
54,472 KB
testcase_19 AC 375 ms
54,484 KB
testcase_20 AC 383 ms
54,456 KB
testcase_21 AC 385 ms
54,260 KB
testcase_22 AC 375 ms
54,312 KB
testcase_23 AC 369 ms
54,264 KB
testcase_24 AC 371 ms
54,276 KB
testcase_25 AC 367 ms
54,372 KB
testcase_26 AC 370 ms
54,272 KB
testcase_27 AC 373 ms
54,132 KB
testcase_28 AC 377 ms
54,404 KB
testcase_29 AC 367 ms
54,408 KB
testcase_30 AC 369 ms
54,264 KB
testcase_31 AC 372 ms
54,152 KB
testcase_32 AC 377 ms
54,076 KB
testcase_33 AC 378 ms
54,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val count = IntArray(10){0}
    val str = readLine()!!.trim()
    for (c in str ){
        if (c.isDigit()) {
            count[c - '0']++
        }
    }
    var from = -1
    var to = -1
    var check = 41038
    for (i in 0 until 10) {
        if (check % 3 != count[i] % 3) {
            if ((check + 1) % 3 == count[i] % 3) {
                to = i
            }else {
                from = i
            }
        }
        check /= 3
    }
    println("$to $from")
}
0