結果

問題 No.346 チワワ数え上げ問題
ユーザー shikatsusanshikatsusan
提出日時 2016-05-18 21:44:06
言語 Haskell
(9.8.2)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 2,035 ms
コンパイル使用メモリ 170,496 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2024-04-15 22:58:49
合計ジャッジ時間 3,007 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 20 ms
12,928 KB
testcase_11 AC 10 ms
9,344 KB
testcase_12 AC 16 ms
11,648 KB
testcase_13 AC 8 ms
9,088 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 15 ms
11,392 KB
testcase_16 AC 17 ms
11,776 KB
testcase_17 AC 20 ms
12,672 KB
testcase_18 AC 21 ms
12,800 KB
testcase_19 AC 18 ms
12,032 KB
testcase_20 AC 23 ms
12,928 KB
testcase_21 AC 25 ms
12,800 KB
testcase_22 AC 25 ms
12,800 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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:15:23: warning: [GHC-47082] [-Woperator-whitespace-ext-conflict]
    The prefix use of a ‘$’ would denote an untyped splice
      were the TemplateHaskell extension enabled.
    Suggested fix: Add whitespace after the ‘$’.
   |
15 |   print . sum . exe 0 $reverse xs
   |                       ^
[2 of 2] Linking a.out

ソースコード

diff #

main::IO()
main = do
  xs <-getLine
  let kaijou 0 = 1
      kaijou n = n * kaijou (n-1)
      nC2 n 
        |n<2    = 0
        |otherwise = n * (n-1) `div` 2
      exe _ [] =[]
      exe n (x:xs)
        |x=='c'    = (nC2 n):exe n xs
        |x=='w'    = exe (n+1) xs
        |otherwise = exe n xs

  print . sum . exe 0 $reverse xs

0