結果

問題 No.3383 1122-like Number (C++)
コンテスト
ユーザー pengin_2000
提出日時 2025-11-22 14:59:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 186 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 29,044 KB
実行使用メモリ 16,080 KB
最終ジャッジ日時 2025-11-22 14:59:21
合計ジャッジ時間 4,864 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 RE * 1
other RE * 1 TLE * 1 -- * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:2:49: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    2 | int main(){int n,i,j,k,f,ans=0;char s[502];scanf("%d%s",&n,s);for(i=0;i<n;i++){for(j=i;j<n;j++){f=1;for(k=0;i+k<j;k++)if(s[i+k]^s[j-k])f=0;ans+=f;}}printf("%d\n",ans);}
      |                                            ~~~~~^~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include<stdio.h>
int main(){int n,i,j,k,f,ans=0;char s[502];scanf("%d%s",&n,s);for(i=0;i<n;i++){for(j=i;j<n;j++){f=1;for(k=0;i+k<j;k++)if(s[i+k]^s[j-k])f=0;ans+=f;}}printf("%d\n",ans);}
0