Task: | Kasihymiö |
Sender: | FSMnArmosta |
Submission time: | 2018-01-15 08:00:00 +0200 |
Language: | Haskell |
Status: | READY |
Result: | 23 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 23 |
#2 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1 | details |
#2 | ACCEPTED | 0.04 s | 1 | details |
#3 | ACCEPTED | 0.04 s | 1 | details |
#4 | ACCEPTED | 0.04 s | 1 | details |
#5 | ACCEPTED | 0.04 s | 1 | details |
#6 | ACCEPTED | 0.21 s | 2 | details |
#7 | RUNTIME ERROR | 0.23 s | 2 | details |
#8 | ACCEPTED | 0.19 s | 2 | details |
#9 | ACCEPTED | 0.24 s | 2 | details |
#10 | ACCEPTED | 0.23 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:3:1: 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:7:1: Warning: Top-level binding with no type signature: main :: IO () input/code.hs:7:34: Warning: Defaulting the following constraint(s) to type `Integer' (Num a0) arising from a use of `t' at input/code.hs:7:34 (Show a0) arising from a use of `print' at input/code.hs:7: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 _ [] = 0 t (!n) ('8':rest) = t (n+1) rest t (!n) (')':rest) = n + (t 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: RUNTIME ERROR
input |
---|
))))))))))))))))))))))))))))))... |
correct output |
---|
0 |
user output |
---|
(empty) |
Error:
Stack space overflow: current size 8388608 bytes. Use `+RTS -Ksize -RTS' to increase it.
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 |