Submission #1466759


Source Code Expand

-- Try AtCoder
-- author: Leonardone @ NEETSDKASU

main = print . solve . read =<< getLine

solve n = ans where
    ans = fst $ foldl h (0, 0) $ map g [1..n]
    g x = (x, f 0 x)
    f a 1 = a
    f a x = f (a + 1 - mod x 2) (div x 2)
    h a@(_, ac) v@(_, vc) = if ac > vc then a else v

Submission Info

Submission Time
Task B - Break Number
User neetsdkasu
Language Haskell (GHC 7.10.3)
Score 200
Code Size 301 Byte
Status AC
Exec Time 2 ms
Memory 508 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 17
Set Name Test Cases
Sample example0, example1, example2, example3
All example0, example1, example2, example3, handmade0, handmade1, handmade2, rand0, rand1, rand2, rand3, rand4, rand5, rand6, rand7, rand8, rand9
Case Name Status Exec Time Memory
example0 AC 1 ms 380 KB
example1 AC 1 ms 508 KB
example2 AC 1 ms 508 KB
example3 AC 1 ms 508 KB
handmade0 AC 1 ms 508 KB
handmade1 AC 1 ms 508 KB
handmade2 AC 1 ms 508 KB
rand0 AC 1 ms 508 KB
rand1 AC 1 ms 508 KB
rand2 AC 1 ms 508 KB
rand3 AC 1 ms 380 KB
rand4 AC 1 ms 508 KB
rand5 AC 1 ms 508 KB
rand6 AC 2 ms 508 KB
rand7 AC 1 ms 508 KB
rand8 AC 1 ms 508 KB
rand9 AC 1 ms 508 KB