結果
| 問題 | No.465 PPPPPPPPPPPPPPPPAPPPPPPPP |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2016-12-15 22:53:42 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 616 bytes |
| 記録 | |
| コンパイル時間 | 207 ms |
| コンパイル使用メモリ | 38,552 KB |
| 最終ジャッジ日時 | 2026-02-23 23:50:22 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 TLE * 1 -- * 13 |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
2 | a[500010];b[500010];
| ^
main.c:2:11: warning: data definition has no type or storage class
2 | a[500010];b[500010];
| ^
main.c: In function 'main':
main.c:10:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
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:50:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
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];
/usr/bin/ld: /tmp/ccgUCeEr.o: in function `main':
main.c:(.text.startup+0x1f): 警告: the `gets' function is dangerous and should not be used.
ソースコード
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;
}
tails