結果

問題 No.495 (^^*) Easy
ユーザー くれちーくれちー
提出日時 2017-03-24 23:14:05
言語 Haskell
(9.8.2)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 6,174 ms
コンパイル使用メモリ 156,144 KB
実行使用メモリ 14,660 KB
最終ジャッジ日時 2023-09-20 03:35:17
合計ジャッジ時間 7,001 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,484 KB
testcase_01 AC 2 ms
6,568 KB
testcase_02 AC 3 ms
6,568 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 3 ms
6,764 KB
testcase_05 AC 4 ms
8,224 KB
testcase_06 AC 23 ms
14,660 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 #

solve :: Integral a => String -> (a, a) -> (a, a)
solve "#" d = d
solve s (l, r) = case take 5 s of
    "(^^*)" -> solve (drop 5 s) (l + 1, r)
    "(*^^)" -> solve (drop 5 s) (l, r + 1)

main = do
    s <- getLine
    let ans = solve s (0, 0)
    putStrLn . unwords . map show $ [fst ans, snd ans]
0