結果
問題 | No.346 チワワ数え上げ問題 |
ユーザー | Tatsuno |
提出日時 | 2016-02-26 23:11:56 |
言語 | Haskell (9.8.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 412 bytes |
コンパイル時間 | 10,349 ms |
コンパイル使用メモリ | 162,896 KB |
実行使用メモリ | 5,016 KB |
最終ジャッジ日時 | 2023-10-24 05:55:40 |
合計ジャッジ時間 | 14,176 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
5,012 KB |
testcase_01 | AC | 3 ms
4,932 KB |
testcase_02 | AC | 2 ms
4,896 KB |
testcase_03 | AC | 2 ms
4,904 KB |
testcase_04 | AC | 3 ms
4,980 KB |
testcase_05 | AC | 2 ms
4,892 KB |
testcase_06 | AC | 3 ms
4,976 KB |
testcase_07 | AC | 2 ms
4,940 KB |
testcase_08 | AC | 2 ms
4,956 KB |
testcase_09 | AC | 3 ms
5,016 KB |
testcase_10 | TLE | - |
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.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
main :: IO () main = do s_ <- getLine let s = filter (\x -> x == 'c' || x== 'w') s_ putStrLn . show $ f s f :: String -> Int f ('c':xs) | length s < 2 = 0 | otherwise = bc (length s) 2 + f xs where s = filter ((==) 'w') xs f (_:xs) = f xs f _ = 0 bc :: Int -> Int -> Int bc _ 0 = 1 bc n k | n < 0 = 0 | n == k = 1 | otherwise = bc (n - 1) (k - 1) + bc (n - 1) k