結果
問題 | No.464 PPAP |
ユーザー |
|
提出日時 | 2016-12-15 22:13:06 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 481 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 22,272 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-11-30 08:38:15 |
合計ジャッジ時間 | 16,769 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 TLE * 5 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:17:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%s",str); | ^~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<string.h> int check(char *str,int s,int e){ int w,i; w=(e-s+1)/2; for(i=0;i<w;i++){ if(str[s+i]!=str[e-i]) return 0; } return 1; } int main(){ char str[5001]; int n,i,j,k; long c=0; scanf("%s",str); n=strlen(str); for(i=0;i<n-3;i++){ if(check(str,0,i)){ for(j=i+1;j<n-2;j++){ if(check(str,i+1,j)){ for(k=n-1;k>j+1;k--){ if(check(str,k,n-1)){ c++; } } } } } } printf("%ld\n",c); return 0; }