結果
問題 | No.588 空白と回文 |
ユーザー |
|
提出日時 | 2017-11-03 22:33:29 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 517 bytes |
コンパイル時間 | 755 ms |
コンパイル使用メモリ | 109,500 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 22:17:34 |
合計ジャッジ時間 | 1,737 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 9 |
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm;import std.typecons, std.range, std.random, std.math, std.container;import std.numeric, std.bigint, core.bitop;const long INF = 1L << 59;void main() {auto S = readln.chomp;auto N = S.length.to!int;int ans = 1;for (int i = 0; i < N; ++i) {int tmp = 1;for (int j = 1; i - j >= 0 && i + j < N; ++j) {if (S[i+j] == S[i-j]) tmp += 2;}ans = max(ans, tmp);}ans.writeln;}