結果
問題 | No.495 (^^*) Easy |
ユーザー | lvs7k |
提出日時 | 2018-09-13 21:06:28 |
言語 | Haskell (9.8.2) |
結果 |
AC
|
実行時間 | 22 ms / 2,000 ms |
コード長 | 459 bytes |
コンパイル時間 | 1,721 ms |
コンパイル使用メモリ | 164,320 KB |
実行使用メモリ | 14,848 KB |
最終ジャッジ日時 | 2023-09-13 19:57:53 |
合計ジャッジ時間 | 1,815 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,912 KB |
testcase_01 | AC | 3 ms
6,912 KB |
testcase_02 | AC | 3 ms
6,956 KB |
testcase_03 | AC | 3 ms
6,992 KB |
testcase_04 | AC | 3 ms
7,116 KB |
testcase_05 | AC | 5 ms
9,008 KB |
testcase_06 | AC | 22 ms
14,848 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
ソースコード
{-# LANGUAGE BangPatterns #-} module Main where import Control.Monad import Data.List (splitAt) import Text.Printf (printf) count :: String -> (Int, Int) count ss = iter 0 0 ss where iter !l !r "#" = (l, r) iter !l !r as | bs == "(^^*)" = iter (l + 1) r cs | bs == "(*^^)" = iter l (r + 1) cs where (bs, cs) = splitAt 5 as main :: IO () main = do ss <- getLine let (l, r) = count ss printf "%d %d\n" l r