結果

問題 No.1005 BOT対策
ユーザー phsplsphspls
提出日時 2020-03-26 00:29:57
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 4,409 ms
コンパイル使用メモリ 105,756 KB
実行使用メモリ 23,516 KB
最終ジャッジ日時 2023-08-30 11:57:33
合計ジャッジ時間 6,076 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
23,432 KB
testcase_01 AC 77 ms
23,496 KB
testcase_02 AC 77 ms
21,460 KB
testcase_03 AC 78 ms
21,212 KB
testcase_04 AC 51 ms
22,436 KB
testcase_05 AC 77 ms
23,380 KB
testcase_06 AC 50 ms
20,420 KB
testcase_07 AC 50 ms
20,512 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 54 ms
20,556 KB
testcase_11 AC 78 ms
21,308 KB
testcase_12 WA -
testcase_13 AC 83 ms
23,456 KB
testcase_14 AC 80 ms
23,448 KB
testcase_15 AC 77 ms
21,504 KB
testcase_16 AC 78 ms
21,356 KB
testcase_17 AC 77 ms
21,508 KB
testcase_18 WA -
testcase_19 AC 51 ms
20,392 KB
testcase_20 AC 50 ms
20,484 KB
testcase_21 AC 56 ms
20,564 KB
testcase_22 AC 55 ms
20,604 KB
testcase_23 AC 77 ms
21,272 KB
testcase_24 AC 77 ms
19,376 KB
testcase_25 AC 77 ms
21,392 KB
testcase_26 AC 78 ms
23,388 KB
testcase_27 AC 51 ms
22,456 KB
testcase_28 WA -
testcase_29 AC 77 ms
21,292 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

public class P1005 {
    public static void Main() {
        var s = Console.ReadLine();
        var t = Console.ReadLine();
        if(t.Length == 1) {
            Console.WriteLine("-1");
        } else {
            int count = 0;
            for(int i=0; i<s.Length + 1 - t.Length; i++) {
                if(s.Substring(i).StartsWith(t)) {
                    count += 1;
                    i += t.Length - 2;
                }
            }
            Console.WriteLine(s.Split(t).Length - 1);
        }
    }
}
0