結果
| 問題 | No.430 文字列検索 |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2016-10-02 23:31:58 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 798 ms / 2,000 ms |
| コード長 | 117 bytes |
| 記録 | |
| コンパイル時間 | 250 ms |
| コンパイル使用メモリ | 28,236 KB |
| 最終ジャッジ日時 | 2026-02-23 22:26:45 |
|
ジャッジサーバーID (参考情報) |
judge5 / 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: In function ‘main’:
main.c:3:48: warning: incompatible implicit declaration of built-in function ‘strstr’ [-Wbuiltin-declaration-mismatch]
3 | for(gets(s),gets(c);gets(c);)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:4:12: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
4 | r=!printf("%d",r);
| ^~~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+++ |+#include <stdio.h>
1 | char s[50010],c[12],*p;r;
/usr/bin/ld: /tmp/ccsKjpYG.o: in function `main':
main.c:(.text.startup+0x1e): 警告: the `gets' function is dangerous and should not be used.
ソースコード
char s[50010],c[12],*p;r;
main(m){
for(gets(s),gets(c);gets(c);)for(p=s;p=strstr(p,c);++p)++r;
r=!printf("%d",r);
}
tails