結果
問題 | No.464 PPAP |
ユーザー | tails |
提出日時 | 2016-12-15 22:19:46 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 403 bytes |
コンパイル時間 | 295 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-11-30 08:39:56 |
合計ジャッジ時間 | 7,579 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
10,496 KB |
testcase_01 | AC | 1 ms
6,656 KB |
testcase_02 | AC | 1 ms
10,496 KB |
testcase_03 | AC | 1 ms
5,248 KB |
testcase_04 | AC | 1 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 0 ms
5,248 KB |
testcase_07 | AC | 194 ms
5,248 KB |
testcase_08 | AC | 11 ms
5,248 KB |
testcase_09 | AC | 1 ms
5,248 KB |
testcase_10 | TLE | - |
testcase_11 | AC | 197 ms
5,248 KB |
testcase_12 | TLE | - |
testcase_13 | AC | 1 ms
5,248 KB |
testcase_14 | AC | 34 ms
5,248 KB |
testcase_15 | AC | 1 ms
5,248 KB |
testcase_16 | AC | 1 ms
5,248 KB |
testcase_17 | AC | 0 ms
5,248 KB |
testcase_18 | AC | 0 ms
5,248 KB |
testcase_19 | AC | 1 ms
5,248 KB |
testcase_20 | AC | 1 ms
5,248 KB |
testcase_21 | AC | 1 ms
5,248 KB |
testcase_22 | AC | 1 ms
5,248 KB |
testcase_23 | AC | 1 ms
5,248 KB |
testcase_24 | AC | 1 ms
5,248 KB |
testcase_25 | AC | 1 ms
6,656 KB |
コンパイルメッセージ
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:9:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 9 | main(i,j,k,l){ | ^~~~ main.c: In function ‘main’: main.c:9:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c:9:1: warning: type of ‘j’ defaults to ‘int’ [-Wimplicit-int] main.c:9:1: warning: type of ‘k’ defaults to ‘int’ [-Wimplicit-int] main.c:9:1: warning: type of ‘l’ defaults to ‘int’ [-Wimplicit-int] main.c:10:9: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 10 | gets(s); | ^~~~ main.c:11:11: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration] 11 | 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:11:11: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch] 11 | l=strlen(s); | ^~~~~~ main.c:11:11: note: include ‘<string.h>’ or provide a declaration of ‘strlen’ main.c:32:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 32 | printf("%lld",r); | ^~~~~~ mai
ソースコード
char s[5010]; a[5010];b[5010]; long long r; f(a,b){ return a>b||s[a]==s[b]&&f(a+1,b-1); } main(i,j,k,l){ 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]; } } for(j=l-2;j>=0;--j){ b[j]+=b[j+1]; } for(i=0;i<l;++i){ r+=a[i]*b[i+2]; } printf("%lld",r); return 0; }