0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

第11回オフラインリアルタイムどう書くの参考問題 感想

0
Posted at

関数型をつきつめると

  1. 数列を元に、すべての部分数列を並べ上げ、
  2. 等差数列だけを残してフィルタし、
  3. 最長のものを出力する

という解法になるんだと思う。
自分の解答(2) は、上記の 1. と 2. が分離されてないので、まだまだ。

ちなみにすべての部分数列を並べ上げるコードをhaskellで書くなら

subseq        :: [Int] -> [[Int]]
subseq []     =  [[]]
subseq (x:xs) =  (map (\xs' -> x:xs') (subseq xs)) ++ (subseq xs)

とかかな?

0
0
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?