結果

問題 No.161 制限ジャンケン
ユーザー shikatsusan
提出日時 2016-05-18 19:26:45
言語 Haskell
(9.10.1)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 409 bytes
コンパイル時間 9,035 ms
コンパイル使用メモリ 174,072 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-30 04:53:17
合計ジャッジ時間 9,786 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
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:4:54: 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 ‘$’.
  |
4 |   wsa <- fmap (\xs-> map (\c-> length . filter (==c) $xs) "GCP") getLine
  |                                                      ^

Main.hs:6:45: 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 ‘$’.
  |
6 |   let sLoop i xs = drop i . concat . repeat $xs
  |                                             ^
[2 of 2] Linking a.out

ソースコード

diff #

main::IO()
main = do
  wsg <- fmap (fmap read . words) getLine
  wsa <- fmap (\xs-> map (\c-> length . filter (==c) $xs) "GCP") getLine

  let sLoop i xs = drop i . concat . repeat $xs
      katiS = zipWith min wsg (sLoop 1 wsa)
      hikiwakeS = zipWith min 
                    (zipWith subtract katiS wsg)
                    (zipWith subtract (sLoop 2 katiS) wsa)
  print $ 3 * sum katiS + sum hikiwakeS 
0