結果

問題 No.588 空白と回文
ユーザー tailstails
提出日時 2017-11-03 22:42:01
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 186 bytes
コンパイル時間 1,083 ms
コンパイル使用メモリ 28,800 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-22 16:06:19
合計ジャッジ時間 1,067 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:14: warning: data definition has no type or storage class
    1 | char s[1010];l;r;
      |              ^
main.c:1:14: warning: type defaults to 'int' in declaration of 'l' [-Wimplicit-int]
main.c:1:16: warning: data definition has no type or storage class
    1 | char s[1010];l;r;
      |                ^
main.c:1:16: 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(d,i,j,c){
      | ^~~~
main.c: In function 'main':
main.c:2:1: warning: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:2:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:2:1: warning: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:2:1: warning: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:3:9: warning: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    3 |         gets(s);
      |         ^~~~
main.c:4:11: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    4 |         l=strlen(s);
      |           ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | char s[1010];l;r;
main.c:4:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    4 |         l=strlen(s);
      |           ^~~~~~
main.c:4:11: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:13:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |         printf("%d",r);
      |         ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | char s[1010];l;r;
main.c:13:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 |         printf("%d",r);
      |         ^~~~~~
main.c:13:9: note: include '<stdio.h>' or provide a declaration of

ソースコード

diff #

char s[1010];l;r;
main(d,i,j,c){
	gets(s);
	l=strlen(s);
	for(d=-l;d<l;++d){
		c=0;
		for(i=0;i<l;++i){
			j=l-1-i+d;
			c+=j>=0&&j<l&&s[i]==s[j];
		}
		if(r<c)r=c;
	}
	printf("%d",r);
}
0