結果
問題 |
No.588 空白と回文
|
ユーザー |
|
提出日時 | 2017-04-13 17:22:27 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 313 bytes |
コンパイル時間 | 158 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 12:56:20 |
合計ジャッジ時間 | 951 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 9 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s",s); | ^~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int main(void) { char s[1024]; int i,j,l,r = 1,nr; scanf("%s",s); l = strlen(s); for(i = 0;i < l;i++){ nr = 1; for(j = 1;j <= 1000;j++){ if(i-j < 0 || i+j >= l){break;} if(s[i-j] == s[i+j]){nr+=2;} } if(nr > r){r = nr;} } printf("%d\n",r); return 0; }