結果
| 問題 | No.3381 Palindrome Substrings (C++) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-07 16:37:07 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 2,000 ms |
| + 506µs | |
| コード長 | 204 bytes |
| 記録 | |
| コンパイル時間 | 1,077 ms |
| コンパイル使用メモリ | 209,072 KB |
| 実行使用メモリ | 7,340 KB |
| スコア | 38 |
| 最終ジャッジ日時 | 2026-07-19 05:52:11 |
| 合計ジャッジ時間 | 5,411 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
main.cpp:1:2: warning: '#import' is a deprecated GCC extension [-Wdeprecated]
1 | #import"bits/stdc++.h"
| ^~~~~~
main.cpp:2:31: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | int N,a,i,j,k,t=1;char S[500];main(){std::cin>>N;for(int x=0;x<N;x++)std::cin>>S[x];for(;i<N;k=j=++i,t=1)for(;j<N;k=++j,t=1){for(;k>=i;--k)t&=S[k]==S[j-k+i];a+=t;}printf("%d\n",a);}
| ^~~~
ソースコード
#import"bits/stdc++.h"
int N,a,i,j,k,t=1;char S[500];main(){std::cin>>N;for(int x=0;x<N;x++)std::cin>>S[x];for(;i<N;k=j=++i,t=1)for(;j<N;k=++j,t=1){for(;k>=i;--k)t&=S[k]==S[j-k+i];a+=t;}printf("%d\n",a);}