結果

問題 No.791 うし数列
ユーザー ktgw0316ktgw0316
提出日時 2019-04-08 21:55:00
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 224 bytes
コンパイル時間 9,291 ms
コンパイル使用メモリ 426,584 KB
実行使用メモリ 54,412 KB
最終ジャッジ日時 2024-04-30 20:16:52
合計ジャッジ時間 14,632 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 299 ms
50,504 KB
testcase_01 AC 251 ms
54,236 KB
testcase_02 WA -
testcase_03 AC 252 ms
54,212 KB
testcase_04 AC 247 ms
54,200 KB
testcase_05 AC 257 ms
54,092 KB
testcase_06 AC 248 ms
54,148 KB
testcase_07 AC 248 ms
54,412 KB
testcase_08 AC 255 ms
54,268 KB
testcase_09 AC 248 ms
54,220 KB
testcase_10 AC 254 ms
54,124 KB
testcase_11 AC 254 ms
54,356 KB
testcase_12 AC 260 ms
54,320 KB
testcase_13 AC 250 ms
54,188 KB
testcase_14 AC 240 ms
54,104 KB
testcase_15 AC 246 ms
54,392 KB
testcase_16 AC 247 ms
54,104 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:6:1: warning: expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of functional types
inline fun ushi(N: String): Int {
^

ソースコード

diff #

fun main(args: Array<String>) {
    val N = readLine()!!
    println(ushi(N))
}

inline fun ushi(N: String): Int {
    if (N[0] != '1') return -1
    val i = N.count {it == '3'}
    return if (i == N.length - 1) i else -1
}
0