結果
問題 | No.430 文字列検索 |
ユーザー | tails |
提出日時 | 2016-10-02 23:27:55 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 777 ms / 2,000 ms |
コード長 | 152 bytes |
コンパイル時間 | 707 ms |
コンパイル使用メモリ | 19,456 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-10 00:03:58 |
合計ジャッジ時間 | 5,772 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 0 ms
5,248 KB |
testcase_01 | AC | 24 ms
5,248 KB |
testcase_02 | AC | 536 ms
5,248 KB |
testcase_03 | AC | 418 ms
5,248 KB |
testcase_04 | AC | 0 ms
5,248 KB |
testcase_05 | AC | 0 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 1 ms
5,248 KB |
testcase_08 | AC | 1 ms
5,248 KB |
testcase_09 | AC | 1 ms
5,248 KB |
testcase_10 | AC | 0 ms
5,248 KB |
testcase_11 | AC | 326 ms
5,248 KB |
testcase_12 | AC | 325 ms
5,248 KB |
testcase_13 | AC | 325 ms
5,248 KB |
testcase_14 | AC | 432 ms
5,248 KB |
testcase_15 | AC | 777 ms
5,248 KB |
testcase_16 | AC | 610 ms
5,248 KB |
testcase_17 | AC | 582 ms
5,248 KB |
コンパイルメッセージ
main.c:1:24: warning: data definition has no type or storage class 1 | char s[50010],c[12],*p;r; | ^ main.c:1:24: warning: type defaults to ‘int’ in declaration of ‘r’ [-Wimplicit-int] main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | main(m){ | ^~~~ main.c: In function ‘main’: main.c:2:1: warning: type of ‘m’ defaults to ‘int’ [-Wimplicit-int] main.c:3:9: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 3 | gets(s); | ^~~~ main.c:4:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 4 | scanf("%d ",&m); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | char s[50010],c[12],*p;r; main.c:4:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 4 | scanf("%d ",&m); | ^~~~~ main.c:4:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:7:27: warning: implicit declaration of function ‘strstr’ [-Wimplicit-function-declaration] 7 | for(p=s;p=strstr(p,c);++p)++r; | ^~~~~~ main.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘strstr’ +++ |+#include <string.h> 1 | char s[50010],c[12],*p;r; main.c:7:27: warning: incompatible implicit declaration of built-in function ‘strstr’ [-Wbuiltin-declaration-mismatch] 7 | for(p=s;p=strstr(p,c);++p)++r; | ^~~~~~ main.c:7:27: note: include ‘<string.h>’ or provide a declaration of ‘strstr’ main.c:9:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 9 | printf("%d",r); | ^~~~~~ main.c:9:9: note: include ‘<stdio.h>’ or provide a decl
ソースコード
char s[50010],c[12],*p;r; main(m){ gets(s); scanf("%d ",&m); for(;m--;){ gets(c); for(p=s;p=strstr(p,c);++p)++r; } printf("%d",r); return 0; }