結果

問題 No.1005 BOT対策
ユーザー キョウチクキョウチク
提出日時 2022-05-17 19:07:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 5,275 ms
コンパイル使用メモリ 71,600 KB
実行使用メモリ 56,296 KB
最終ジャッジ日時 2023-10-13 18:23:55
合計ジャッジ時間 11,026 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,652 KB
testcase_01 AC 121 ms
55,988 KB
testcase_02 AC 121 ms
56,056 KB
testcase_03 AC 123 ms
55,684 KB
testcase_04 WA -
testcase_05 AC 124 ms
56,296 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 123 ms
55,824 KB
testcase_09 AC 123 ms
55,928 KB
testcase_10 AC 124 ms
56,204 KB
testcase_11 AC 124 ms
55,600 KB
testcase_12 AC 123 ms
55,508 KB
testcase_13 AC 124 ms
56,092 KB
testcase_14 AC 126 ms
55,688 KB
testcase_15 AC 125 ms
55,868 KB
testcase_16 AC 123 ms
55,652 KB
testcase_17 AC 125 ms
55,656 KB
testcase_18 AC 124 ms
55,632 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 125 ms
55,488 KB
testcase_22 AC 128 ms
55,816 KB
testcase_23 AC 124 ms
56,036 KB
testcase_24 AC 123 ms
56,012 KB
testcase_25 AC 123 ms
55,960 KB
testcase_26 AC 123 ms
55,812 KB
testcase_27 WA -
testcase_28 AC 121 ms
56,056 KB
testcase_29 AC 120 ms
54,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test11 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String line;
    line=sc.nextLine();
    String msg=line;
    line=sc.nextLine();
    String target=line;
    int msg_l=msg.length(),target_l=target.length(),targeted=0;
    for(int i=0;i<msg_l-target_l+1;i++){
      String tmp=msg.substring(i,i+target_l);
      if(tmp.equals(target)){
        targeted++;
        if(2<target_l){
          i+=target_l-2;
        }
      }
    }
    System.out.println(targeted);
    sc.close();
  }
}
0