結果
問題 | No.464 PPAP |
ユーザー | tails |
提出日時 | 2016-12-15 22:42:54 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 610 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-30 08:49:27 |
合計ジャッジ時間 | 1,065 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 0 ms
6,820 KB |
testcase_01 | AC | 1 ms
6,816 KB |
testcase_02 | AC | 1 ms
6,816 KB |
testcase_03 | AC | 1 ms
6,816 KB |
testcase_04 | AC | 1 ms
6,816 KB |
testcase_05 | AC | 0 ms
6,816 KB |
testcase_06 | AC | 1 ms
6,820 KB |
testcase_07 | AC | 1 ms
6,816 KB |
testcase_08 | AC | 1 ms
6,820 KB |
testcase_09 | AC | 0 ms
6,816 KB |
testcase_10 | AC | 20 ms
6,816 KB |
testcase_11 | AC | 6 ms
6,816 KB |
testcase_12 | AC | 9 ms
6,820 KB |
testcase_13 | AC | 1 ms
6,820 KB |
testcase_14 | AC | 1 ms
6,816 KB |
testcase_15 | AC | 1 ms
6,816 KB |
testcase_16 | AC | 1 ms
6,816 KB |
testcase_17 | AC | 1 ms
6,816 KB |
testcase_18 | AC | 1 ms
6,816 KB |
testcase_19 | AC | 1 ms
6,816 KB |
testcase_20 | AC | 1 ms
6,816 KB |
testcase_21 | AC | 1 ms
6,816 KB |
testcase_22 | AC | 1 ms
6,816 KB |
testcase_23 | AC | 0 ms
6,820 KB |
testcase_24 | AC | 1 ms
6,816 KB |
testcase_25 | AC | 1 ms
6,816 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: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[5010]; 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[5010]; main.c:50:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbu
ソースコード
char s[5010]; a[5010];b[5010]; 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; }