RSieve icon

Old Haskell exams for LPP

RSieve | PRO | 09/10/18 11:56:37 AM UTC | 0 ⭐ | 12225 👁️ | Never ⏰ | []
Haskell |

1.21 KB

|

None

|

0 👍

/

0 👎

-- exam 24/01/2018
 
ex1 :: [Int] -> Int
ex1 [] = 0
ex1 x = aux x 1
    where
        aux [] _ = 0
        aux (x : xs) n = ((2 ^ (n - 1)) * x) + aux xs n+1
 
ex2 :: [Int] -> Int
ex2 [] = 0
ex2 x = sum (map (\(x, n) -> 2 ^ (n - 1) * x) (zip x [1..]))
 
-- exam 24/02/2018
 
ex3 :: (a -> Bool) -> [a] -> [Int]
ex3 _ [] = []
ex3 p x = aux p x 0
    where
        aux _ [] _ = []
        aux p (x : xs) n | p x = n : aux p xs (n + 1)
                         | otherwise = aux p xs (n + 1)
 
ex4 :: (a -> Bool) -> [a] -> [Int]
ex4 _ [] = []
ex4 p x = map snd (filter (p.fst) (zip x [0..]))
 
-- exam 18/06/2018
 
ex5 :: [Int] -> Int -> Int
ex5 [] _ = 0
ex5 x y = aux x y 0
    where
        aux [] _ _ = 0
        aux (x : xs) y n = (x * (y ^ n)) + aux xs y (n+1)
 
ex6 :: [Int] -> Int -> Int
ex6 [] _ = 0
ex6 x y = sum (map (\(x, n) -> x * (y ^n)) (zip x [0..]))
 
-- exam 24/07/2018
 
ex7 :: [Int] -> Int
ex7 [] = 0
ex7 x = aux x 0
    where
        aux [] _ = 0
        aux (x : xs) n | n `mod` 2 == 0 = x + aux xs (n + 1)
                       | otherwise = (- x) + aux xs (n + 1)
 
ex8 :: [Int] -> Int
ex8 [] = 0
ex8 x = sum (map (\(x, n) -> if n `mod` 2 == 0 then x else - x) (zip x [0..]))

Comments

  • Nikpuonoz icon
    03/29/26 09:52:34 PM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎