結果
問題 | No.464 PPAP |
ユーザー | Hirotaka Ohkubo |
提出日時 | 2017-03-02 18:34:37 |
言語 | Haskell (9.10.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 509 bytes |
コンパイル時間 | 4,303 ms |
コンパイル使用メモリ | 178,548 KB |
実行使用メモリ | 16,420 KB |
最終ジャッジ日時 | 2024-06-13 01:31:52 |
合計ジャッジ時間 | 7,807 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
13,768 KB |
testcase_01 | AC | 1 ms
6,816 KB |
testcase_02 | AC | 1 ms
6,940 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | AC | 7 ms
7,680 KB |
testcase_05 | AC | 4 ms
7,936 KB |
testcase_06 | AC | 2 ms
6,940 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.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) Main.hs:10:29: warning: [GHC-63394] [-Wx-partial] In the use of ‘tail’ (imported from Data.List, but defined in GHC.List): "This is a partial function, it throws an error on empty lists. Replace it with drop 1, or use pattern matching or Data.List.uncons instead. Consider refactoring to use Data.List.NonEmpty." | 10 | p1s = [ length p1 | p1 <- tail $ inits $ take (len-3) src, pali p1 ] | ^^^^ Main.hs:11:48: warning: [GHC-63394] [-Wx-partial] In the use of ‘tail’ (imported from Data.List, but defined in GHC.List): "This is a partial function, it throws an error on empty lists. Replace it with drop 1, or use pattern matching or Data.List.uncons instead. Consider refactoring to use Data.List.NonEmpty." | 11 | p1p2s = [ (p1, length p2) | p1 <- p1s, p2 <- tail $ inits $ drop p1 $ take (len-2) src, pali p2 ] | ^^^^ [2 of 2] Linking a.out
ソースコード
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