結果
問題 |
No.430 文字列検索
|
ユーザー |
![]() |
提出日時 | 2016-10-07 16:16:13 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 947 bytes |
コンパイル時間 | 769 ms |
コンパイル使用メモリ | 111,476 KB |
実行使用メモリ | 36,284 KB |
最終ジャッジ日時 | 2024-11-10 00:09:54 |
合計ジャッジ時間 | 5,410 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 2 TLE * 1 -- * 11 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace ConsoleApplication1 { class Program { static string S; static int sum; static void Main(string[] args) { S = Console.ReadLine(); sum = 0; var m = int.Parse(Console.ReadLine()); for (int i = 0; i < m; i++) { var str = Console.ReadLine(); CheckStr(str); } Console.WriteLine(sum); } private static void CheckStr(string str) { for (int i = 0; i < S.Length; i++) { if(str[0] == S[i]) { if (i + str.Length > S.Length) break; var sub = S.Substring(i, str.Length); if(str == sub) { sum++; } } } } } }