結果

問題 No.345 最小チワワ問題
ユーザー Hirotaka OhkuboHirotaka Ohkubo
提出日時 2016-07-27 00:54:06
言語 Haskell
(9.6.2)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 8,071 ms
コンパイル使用メモリ 165,992 KB
実行使用メモリ 7,276 KB
最終ジャッジ日時 2023-08-06 14:10:11
合計ジャッジ時間 9,560 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,460 KB
testcase_01 AC 2 ms
6,460 KB
testcase_02 AC 2 ms
6,524 KB
testcase_03 AC 3 ms
6,652 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 3 ms
6,584 KB
testcase_08 AC 2 ms
6,496 KB
testcase_09 AC 3 ms
6,412 KB
testcase_10 AC 2 ms
6,556 KB
testcase_11 AC 2 ms
6,396 KB
testcase_12 AC 3 ms
7,276 KB
testcase_13 AC 2 ms
6,404 KB
testcase_14 WA -
testcase_15 AC 2 ms
6,464 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 3 ms
6,444 KB
testcase_20 AC 2 ms
6,464 KB
testcase_21 AC 3 ms
6,444 KB
testcase_22 AC 2 ms
6,444 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
6,536 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 3 ms
6,452 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

main = do
  cs <- getLine
  print $ compute cs

compute cs = if null lens then -1 else head lens where
  lens =
   [ length as + length cs + 3
   | ('c':xs) <- tails cs
   , let (as,bs) = break ('w' ==) xs
   , not $ null bs
   , let (cs,ds) = break ('w' ==) $ tail bs
   , not $ null ds
   ]
0