結果
問題 | No.273 回文分解 |
ユーザー |
|
提出日時 | 2019-01-23 23:29:07 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 330 bytes |
コンパイル時間 | 2,571 ms |
コンパイル使用メモリ | 61,368 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 10:40:14 |
合計ジャッジ時間 | 3,610 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
template `max=`*(x,y) = x = max(x,y)proc check(S:string) : bool =for i in 0..<S.len div 2:if S[i] != S[^(1+i)] : return falsereturn truelet S = stdin.readLine()var ans = 1for i in 0..<S.len:for j in (i+1)..<S.len:if i == 0 and j == S.len - 1 : continueif S[i..j].check() : ans .max= j - i + 1echo ans