Task: | Kasihymiö |
Sender: | FSMnArmosta |
Submission time: | 2018-01-15 09:26:40 +0200 |
Language: | Haskell |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 23 |
#2 | ACCEPTED | 77 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1 | details |
#2 | ACCEPTED | 0.06 s | 1 | details |
#3 | ACCEPTED | 0.04 s | 1 | details |
#4 | ACCEPTED | 0.04 s | 1 | details |
#5 | ACCEPTED | 0.05 s | 1 | details |
#6 | ACCEPTED | 0.21 s | 2 | details |
#7 | ACCEPTED | 0.15 s | 2 | details |
#8 | ACCEPTED | 0.20 s | 2 | details |
#9 | ACCEPTED | 0.17 s | 2 | details |
#10 | ACCEPTED | 0.20 s | 2 | details |
Compiler report
input/code.hs:3:1: Warning: Top-level binding with no type signature: t :: forall a. Num a => a -> [Char] -> a input/code.hs:5:5: Warning: Pattern match(es) are non-exhaustive In an equation for t': Patterns not matched: _ _ ((GHC.Types.C# #x) : _) with #x `notElem` ['8', ')'] input/code.hs:9:1: Warning: Top-level binding with no type signature: main :: IO () input/code.hs:9:34: Warning: Defaulting the following constraint(s) to type `Integer' (Num a0) arising from a use of `t' at input/code.hs:9:34 (Show a0) arising from a use of `print' at input/code.hs:9:27-31 In the first argument of `print', namely `(t 0 l)' In the expression: print (t 0 l) In the second argument of `(>>=)', namely `(\ l -> print (t 0 l))'
Code
{-# LANGUAGE BangPatterns #-} t n0 xs = t' 0 n0 xs where t' !acc !_n [] = acc t' acc n ('8':rest) = t' acc (n + 1) rest t' acc n (')':rest) = t' (acc + n) n rest main = getLine >>= (\l -> print (t 0 l))
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
888888888888888888888888888888... |
correct output |
---|
0 |
user output |
---|
0 |
Test 2
Group: 1
Verdict: ACCEPTED
input |
---|
))))))))))))))))))))))))))))))... |
correct output |
---|
0 |
user output |
---|
0 |
Test 3
Group: 1
Verdict: ACCEPTED
input |
---|
888888888888888888888888888888... |
correct output |
---|
250000 |
user output |
---|
250000 |
Test 4
Group: 1
Verdict: ACCEPTED
input |
---|
8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)... |
correct output |
---|
125250 |
user output |
---|
125250 |
Test 5
Group: 1
Verdict: ACCEPTED
input |
---|
8)88))))88))8)))8))8))888))888... |
correct output |
---|
127050 |
user output |
---|
127050 |
Test 6
Group: 2
Verdict: ACCEPTED
input |
---|
888888888888888888888888888888... |
correct output |
---|
0 |
user output |
---|
0 |
Test 7
Group: 2
Verdict: ACCEPTED
input |
---|
))))))))))))))))))))))))))))))... |
correct output |
---|
0 |
user output |
---|
0 |
Test 8
Group: 2
Verdict: ACCEPTED
input |
---|
888888888888888888888888888888... |
correct output |
---|
250000000000 |
user output |
---|
250000000000 |
Test 9
Group: 2
Verdict: ACCEPTED
input |
---|
8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)... |
correct output |
---|
125000250000 |
user output |
---|
125000250000 |
Test 10
Group: 2
Verdict: ACCEPTED
input |
---|
888)888))8)88)8))88)888)88))8)... |
correct output |
---|
125162819188 |
user output |
---|
125162819188 |