結果

問題 No.464 PPAP
ユーザー Hirotaka OhkuboHirotaka Ohkubo
提出日時 2017-03-02 18:34:37
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 509 bytes
コンパイル時間 8,182 ms
コンパイル使用メモリ 165,708 KB
実行使用メモリ 13,720 KB
最終ジャッジ日時 2023-09-03 20:46:41
合計ジャッジ時間 8,872 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
13,720 KB
testcase_01 AC 3 ms
6,684 KB
testcase_02 AC 3 ms
6,640 KB
testcase_03 AC 2 ms
6,636 KB
testcase_04 AC 12 ms
10,768 KB
testcase_05 AC 6 ms
10,736 KB
testcase_06 AC 3 ms
7,432 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List

pali xs = xs == reverse xs

compute = length . comp4s

comp4s src = quads where
  len = length src
  p3s = reverse [ length p3 | p3 <- init $ tails $ drop 3 src, pali p3 ]
  p1s = [ length p1 | p1 <- tail $ inits $ take (len-3) src, pali p1 ]
  p1p2s = [ (p1, length p2) | p1 <- p1s, p2 <- tail $ inits $ drop p1 $ take (len-2) src, pali p2 ]
  quads = [ (p1,p2,len - p1 - p2 - p3,p3) | (p1,p2) <- p1p2s, p3 <- takeWhile (len - p1 - p2 >) p3s ]

main = do
  l <- getLine
  print $ compute l
0