結果

問題 No.791 うし数列
ユーザー バカらっくバカらっく
提出日時 2022-02-03 12:30:29
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 275 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 10,853 ms
コンパイル使用メモリ 416,448 KB
実行使用メモリ 53,000 KB
最終ジャッジ日時 2023-09-02 03:09:56
合計ジャッジ時間 16,411 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 264 ms
52,832 KB
testcase_01 AC 262 ms
52,716 KB
testcase_02 AC 264 ms
52,884 KB
testcase_03 AC 259 ms
52,712 KB
testcase_04 AC 264 ms
52,984 KB
testcase_05 AC 261 ms
52,896 KB
testcase_06 AC 256 ms
52,760 KB
testcase_07 AC 270 ms
52,672 KB
testcase_08 AC 267 ms
52,844 KB
testcase_09 AC 273 ms
52,544 KB
testcase_10 AC 275 ms
52,724 KB
testcase_11 AC 269 ms
52,700 KB
testcase_12 AC 270 ms
52,780 KB
testcase_13 AC 266 ms
53,000 KB
testcase_14 AC 269 ms
52,536 KB
testcase_15 AC 265 ms
52,720 KB
testcase_16 AC 267 ms
52,808 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    println(getAns())
}

fun getAns():Int {
    val n = readLine()!!
    if(n.first() != '1') {
        return -1
    }
    val tmp = n.drop(1)
    if(tmp.isEmpty()) {
        return -1
    }
    if(tmp.all { it == '3' }) {
        return tmp.length
    }
    return -1
}
0