結果
問題 | No.430 文字列検索 |
ユーザー | tails |
提出日時 | 2016-10-02 23:27:55 |
言語 | C90 (gcc 12.3.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 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
コンパイルメッセージ
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; }