結果
| 問題 | No.430 文字列検索 |
| コンテスト | |
| ユーザー |
htensai
|
| 提出日時 | 2019-11-19 21:01:05 |
| 言語 | Java (openjdk 27 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,442 ms / 2,000 ms |
| + 367µs | |
| コード長 | 413 bytes |
| 記録 | |
| コンパイル時間 | 1,625 ms |
| コンパイル使用メモリ | 100,288 KB |
| 実行使用メモリ | 50,848 KB |
| 最終ジャッジ日時 | 2026-10-15 19:26:42 |
| 合計ジャッジ時間 | 14,815 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 |
ソースコード
import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
String target = sc.next();
int m = sc.nextInt();
int count = 0;
for (int i = 0; i < m; i++) {
String test = sc.next();
int idx = 0;
while ((idx = target.indexOf(test, idx)) != -1) {
idx++;
count++;
}
}
System.out.println(count);
}
}
htensai