結果

問題 No.346 チワワ数え上げ問題
ユーザー HaarHaar
提出日時 2016-06-17 19:32:54
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 224 bytes
コンパイル時間 1,661 ms
コンパイル使用メモリ 174,336 KB
実行使用メモリ 19,228 KB
最終ジャッジ日時 2024-04-17 23:13:45
合計ジャッジ時間 10,974 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
19,228 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 790 ms
12,800 KB
testcase_11 AC 313 ms
9,344 KB
testcase_12 AC 584 ms
9,856 KB
testcase_13 AC 232 ms
9,088 KB
testcase_14 AC 4 ms
6,940 KB
testcase_15 AC 511 ms
9,728 KB
testcase_16 AC 702 ms
9,984 KB
testcase_17 AC 820 ms
12,800 KB
testcase_18 AC 812 ms
12,800 KB
testcase_19 AC 754 ms
9,984 KB
testcase_20 TLE -
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:3:56: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in four further locations.
    Suggested fix: Please use spaces instead.
  |
3 | solve ('c':xs) = count * (count - 1) `div` 2 + solve xs where
  |                                                        ^
[2 of 2] Linking a.out

ソースコード

diff #

solve :: String -> Integer
solve [] = 0
solve ('c':xs) = count * (count - 1) `div` 2 + solve xs	where
		count = fromIntegral $ length (filter (=='w') xs)
solve (_:xs) = solve xs

main = do
	str <- getLine
	print $ solve str
0