結果
問題 | No.465 PPPPPPPPPPPPPPPPAPPPPPPPP |
ユーザー |
![]() |
提出日時 | 2016-12-15 22:53:42 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 616 bytes |
コンパイル時間 | 131 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-11-30 08:51:28 |
合計ジャッジ時間 | 26,331 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 1 TLE * 8 |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | a[500010];b[500010]; | ^ main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] main.c:2:11: warning: data definition has no type or storage class 2 | a[500010];b[500010]; | ^ main.c:2:11: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int] main.c:8:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 8 | main(i,j,k,l,m){ | ^~~~ main.c: In function ‘main’: main.c:8:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c:8:1: warning: type of ‘j’ defaults to ‘int’ [-Wimplicit-int] main.c:8:1: warning: type of ‘k’ defaults to ‘int’ [-Wimplicit-int] main.c:8:1: warning: type of ‘l’ defaults to ‘int’ [-Wimplicit-int] main.c:8:1: warning: type of ‘m’ defaults to ‘int’ [-Wimplicit-int] main.c:9:9: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 9 | gets(s); | ^~~~ main.c:10:11: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration] 10 | l=strlen(s); | ^~~~~~ main.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘strlen’ +++ |+#include <string.h> 1 | char s[500010]; main.c:10:11: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch] 10 | l=strlen(s); | ^~~~~~ main.c:10:11: note: include ‘<string.h>’ or provide a declaration of ‘strlen’ main.c:50:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 50 | printf("%lld",r); | ^~~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ +++ |+#include <stdio.h> 1 | char s[500010]; main.c:50:9: warning: incompatible implicit declaration of built-in function ��
ソースコード
char s[500010];a[500010];b[500010];long long r;typedef long long H;H rm=1000000007;main(i,j,k,l,m){gets(s);l=strlen(s);H r1=0;H r2=0;H r3=1;for(i=0;i<l;++i){r1=r1*rm+s[i];r2=r2+r3*s[i];r3*=rm;if(r1==r2){H r4=0;H r5=0;H r6=1;for(j=i+1;j<l;++j){r4=r4*rm+s[j];r5=r5+r6*s[j];r6*=rm;if(r4==r5){++a[j];}}}}{H r7=0;H r8=0;H r9=1;for(j=j-1;j>=0;--j){r7=r7*rm+s[j];r8=r8+r9*s[j];r9*=rm;if(r7==r8){++b[j];}}}m=0;for(i=0;i<l;++i){m+=a[i];r+=m*b[i+2];}printf("%lld",r);return 0;}