結果

問題 No.1005 BOT対策
ユーザー 👑 箱星箱星
提出日時 2020-03-06 21:35:38
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 879 bytes
コンパイル時間 11,251 ms
コンパイル使用メモリ 437,484 KB
実行使用メモリ 51,292 KB
最終ジャッジ日時 2024-04-22 11:11:21
合計ジャッジ時間 21,518 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
51,168 KB
testcase_01 AC 297 ms
51,040 KB
testcase_02 AC 299 ms
51,112 KB
testcase_03 AC 299 ms
51,056 KB
testcase_04 AC 300 ms
51,012 KB
testcase_05 AC 299 ms
50,864 KB
testcase_06 AC 300 ms
51,056 KB
testcase_07 AC 300 ms
51,136 KB
testcase_08 AC 297 ms
50,936 KB
testcase_09 AC 295 ms
51,136 KB
testcase_10 AC 296 ms
51,040 KB
testcase_11 AC 301 ms
51,052 KB
testcase_12 WA -
testcase_13 AC 303 ms
50,900 KB
testcase_14 AC 300 ms
51,240 KB
testcase_15 AC 300 ms
50,904 KB
testcase_16 AC 298 ms
51,044 KB
testcase_17 AC 300 ms
51,004 KB
testcase_18 AC 299 ms
50,804 KB
testcase_19 AC 300 ms
50,960 KB
testcase_20 AC 302 ms
51,108 KB
testcase_21 AC 296 ms
51,008 KB
testcase_22 AC 296 ms
50,784 KB
testcase_23 AC 299 ms
50,824 KB
testcase_24 AC 298 ms
51,060 KB
testcase_25 AC 303 ms
51,292 KB
testcase_26 AC 304 ms
51,168 KB
testcase_27 AC 308 ms
51,032 KB
testcase_28 WA -
testcase_29 AC 300 ms
51,036 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:7:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.lang.StringBuilder
import java.util.*

fun main(args: Array<String>) {
    val sc = FastScanner(System.`in`)
    val s = sc.nextLine()
    val t = sc.nextLine()
    val count = (s.length - s.replace(t, "").length) / t.length
    if (count > 0 && t.length == 1) {
        println(-1)
    } else {
        println(count)
    }
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    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()
    fun ready() = br.ready()
}
0