結果

問題 No.464 PPAP
ユーザー tailstails
提出日時 2016-12-15 22:29:25
言語 C90
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 408 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 21,248 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-05-07 15:08:00
合計ジャッジ時間 3,814 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
10,624 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 0 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 43 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
    2 | a[5010];b[5010];
      | ^
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
main.c:2:9: warning: data definition has no type or storage class
    2 | a[5010];b[5010];
      |         ^
main.c:2:9: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int]
main.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    5 | f(a,b){
      | ^
main.c: In function ‘f’:
main.c:5:1: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:1: warning: type of ‘b’ defaults to ‘int’ [-Wimplicit-int]
main.c: At top level:
main.c:12:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
   12 | main(i,j,k,l,m){
      | ^~~~
main.c: In function ‘main’:
main.c:12:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int]
main.c:12:1: warning: type of ‘j’ defaults to ‘int’ [-Wimplicit-int]
main.c:12:1: warning: type of ‘k’ defaults to ‘int’ [-Wimplicit-int]
main.c:12:1: warning: type of ‘l’ defaults to ‘int’ [-Wimplicit-int]
main.c:12:1: warning: type of ‘m’ defaults to ‘int’ [-Wimplicit-int]
main.c:13:9: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration]
   13 |         gets(s);
      |         ^~~~
main.c:14:11: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
   14 |         l=strlen(s);
      |           ^~~~~~
main.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
  +++ |+#include <string.h>
    1 | char s[5010];
main.c:14:11: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch]
   14 |         l=strlen(s);
      |           ^~~~~~
main.c:14:11: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
main.c:34:9: warning: implicit declaration of function ‘printf’ [-Wimplici

ソースコード

diff #

char s[5010];
a[5010];b[5010];
long long r;

f(a,b){
	char*p=s+a;
	char*q=s+b;
	while(p<q&&*p==*q)++p,--q;
	return p>=q;
}

main(i,j,k,l,m){
	gets(s);
	l=strlen(s);
	for(i=0;i<l;++i){
		if(f(0,i)){
			for(j=i+1;j<l;++j){
				if(f(i+1,j)){
					++a[j];
				}
			}
		}
	}
	for(j=0;j<l;++j){
		if(f(j,l-1)){
			++b[j];
		}
	}
	m=0;
	for(i=0;i<l;++i){
		m+=a[i];
		r+=m*b[i+2];
	}
	printf("%lld",r);
	return 0;
}
0