結果

問題 No.1367 文字列門松
ユーザー 👑 箱
提出日時 2021-02-05 23:04:18
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 777 bytes
コンパイル時間 15,996 ms
コンパイル使用メモリ 417,552 KB
実行使用メモリ 50,516 KB
最終ジャッジ日時 2023-09-15 10:37:50
合計ジャッジ時間 24,774 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 272 ms
50,088 KB
testcase_01 AC 271 ms
50,516 KB
testcase_02 AC 269 ms
50,148 KB
testcase_03 AC 272 ms
50,304 KB
testcase_04 AC 269 ms
49,956 KB
testcase_05 AC 272 ms
50,480 KB
testcase_06 AC 268 ms
50,036 KB
testcase_07 AC 269 ms
50,204 KB
testcase_08 AC 266 ms
50,036 KB
testcase_09 AC 268 ms
50,312 KB
testcase_10 AC 270 ms
50,244 KB
testcase_11 AC 268 ms
49,972 KB
testcase_12 AC 270 ms
50,276 KB
testcase_13 AC 265 ms
50,176 KB
testcase_14 AC 266 ms
50,296 KB
testcase_15 AC 264 ms
50,116 KB
testcase_16 AC 266 ms
50,032 KB
testcase_17 AC 266 ms
50,032 KB
testcase_18 AC 265 ms
50,064 KB
testcase_19 AC 267 ms
50,092 KB
testcase_20 AC 265 ms
50,080 KB
testcase_21 AC 266 ms
50,104 KB
testcase_22 AC 270 ms
49,952 KB
testcase_23 AC 266 ms
50,028 KB
testcase_24 AC 264 ms
50,432 KB
testcase_25 AC 264 ms
50,200 KB
testcase_26 AC 264 ms
50,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

fun PrintWriter.solve() {
    val s = nextLine()
    val t = "kadomatsu"
    var idx = 0
    for (c in t) {
        if (idx < s.length && s[idx] == c) {
            idx++
        }
    }
    println(if (idx == s.length) "Yes" else "No")
}

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