Created
August 1, 2019 13:48
-
-
Save wsgac/8d4b0feb65b1c63dfc5037e830cd9080 to your computer and use it in GitHub Desktop.
PicoLisp solution for the Above Average problem on Kattis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Kattis - Above Average | |
| # https://open.kattis.com/problems/aboveaverage | |
| (load "@lib/math.l") | |
| (de getInput () | |
| (mapcar '((Row) (mapcar '((El) (read)) | |
| (range 1 (read)))) | |
| (range 1 (read)))) | |
| (de processClass (Grades) | |
| (let (Avg (/ (apply + Grades) (length Grades)) | |
| Above (filter '((X) (> X Avg)) Grades)) | |
| (native "@" "printf" 'I "%.3f%\n" (cons (* 100 (length Above)) (length Grades))))) | |
| # (mapc processClass (getInput)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment