BottomCoder SRM 327 Div2

結果

250500900合計
245.50Failed System Test-245.50

終了15分前頃から参加させていただきました. 500が簡単だと思ったら, ミス! 解法が悪かったですね.

  • 250 : 全探索
  • 500 : 少し工夫して探索

みたいな感じで解きました.
900は時間がなかったので見ていません.

250点問題で英語のお勉強

恥ずかしながらわからない単語
  • alternating : 交互の
    • 音楽用語で, オルタネイティングベースとか言うよね
  • clarity : 明確さ
問題文訳

A sequence of characters is called a fence if it consists of alternating '|' and '-' characters, like "|-|-|-|" or "-|-|" (quotes for clarity only).
"|-|-|-|" や "-|-|" のように, '|'と'-'の交互の文字で構成される文字列のことをフェンスと呼ぶ.(明確さのためだけに引用符を用いている)


Notice that "|-||-|" or "--" are not fences, because each contains two equal characters adjacent to each other.
"|-||-|" や "--" はフェンスではないことに注意.
2つの同じ文字が隣り合って出ているためである.


Given a string s, find the longest consecutive substring of it that is a fence, and return its length.
文字列sが与えられたとき, この文字列の連続する部分文字列で最長のフェンスの長さを求めよ.