Topic | Users | Replies | Views | Activity |
---|---|---|---|---|
Increasing time limits
If you have written a program in a functional language (or Python, or Java) and received TLE, if you are convinced that you are using the best possible approach (in particular, that an equivalent program in C would have …
read more
|
![]() ![]() ![]() ![]() ![]() |
45 | 4.2k | Jun '23 |
Solution to TEST in Scheme
(define (do_it n)
(define (print_it n)
(display n)
(newline))
(cond ((not(= n 42))
(print_it n)
(do_it (read)))))
(do_it (read))
|
![]() ![]() ![]() ![]() |
3 | 1.3k | Aug '12 |
Solution to Test in Erlang
-module(tested).
-export([main/0]).
main() ->
loop().
loop() ->
case io:fread( "","~d" ) of
eof ->
true;
{ok, X} ->
[Y] = X…
read more
|
![]() ![]() |
1 | 1.1k | Jun '12 |
Solution to TEST in Lisp
(loop
(let ((a (read)))
(when (= a 42) (return))
(princ (format nil "~D~%" a))))
|
![]() ![]() ![]() ![]() ![]() |
4 | 1.4k | Sep '11 |
Solution to TEST in OCaml
let _ =
let rec write i =
print_int i;
print_newline ();
read ()
and read () =
match read_int () with
| 42 -> ()
| i -> write i
in read ()
;;
|
![]() ![]() |
1 | 1.1k | Dec '06 |
Solution to TEST in Haskell
main = interact f
where f = unlines . takeWhile (/="42") . words
|
![]() |
0 | 1.1k | Jun '04 |
Solution to TEST in CLIPS
The program is run via the sequence of commands: (clear)(load "...")(reset)(assert spoj-non-interactive)(run). Don't make any assumptions about the strategy of inferrence (it is currently DFS, but subject to change to BF…
read more
|
![]() |
0 | 1.0k | Jun '04 |
Solution to TEST in Prolog
The first and only predicate to be checked is 'program', with no arguments.
program :- get_char(X),get_char(Y),check(X,Y).
check('4','2'):-!.
check(X,Y):-write(X),get_char(Z),check(Y,Z).
|
![]() |
0 | 984 | Jun '04 |
About the Functional programming corner category
Discussion on functional and predicate programming languages (Haskell, O'Caml, Prolog, Scheme, Lisp, Clips) at SPOJ
|
![]() |
0 | 1.0k | Jun '04 |
OCaml upgrade request |
![]() |
0 | 350 | Feb '23 |
Fixing guile |
![]() |
0 | 410 | May '22 |
Is scheme interpreter working? |
![]() ![]() |
1 | 991 | Jul '21 |
Problem BRI passes with C++ but Haskell gives TLE |
![]() ![]() |
1 | 1.0k | Jun '21 |
Runtime error when using phrase/2 with GNU Prolog` |
![]() |
0 | 534 | Oct '20 |
PRIME1 in Common Lisp |
![]() ![]() |
2 | 872 | Sep '20 |
[Haskell] Libraries for parallel execution |
![]() |
0 | 856 | Oct '19 |
COINS in Prolog |
![]() |
0 | 760 | Mar '19 |
Problem with chicken scheme interpreter? |
![]() |
1 | 984 | Aug '17 |
Haskell: memory usage is always 16384M after update to ghc 8 |
![]() |
0 | 984 | Feb '17 |
Is SPOJ’s chicken scheme using the compiler or interpteter? |
![]() |
0 | 1.0k | Nov '16 |
Add packages to Haskell |
![]() |
0 | 964 | Aug '16 |
What the problem here? |
![]() ![]() |
1 | 1.2k | Apr '16 |
Solution to TEST in Clojure? |
![]() |
1 | 1.3k | Feb '16 |
Introduction of Fsharp |
![]() ![]() ![]() |
2 | 1.0k | Apr '15 |
Haskell GHC upgrade request |
![]() ![]() ![]() |
2 | 1.0k | Jan '15 |
7487. Flibonakki TLE |
![]() ![]() ![]() ![]() ![]() |
8 | 1.4k | Jan '15 |
IO Routines in haskell |
![]() ![]() ![]() ![]() ![]() |
11 | 1.5k | Dec '14 |
OCaml: Is it possible to turn on support for streams? |
![]() ![]() ![]() ![]() |
3 | 1.2k | Nov '14 |
Time limit on PALIN with Haskell |
![]() ![]() |
3 | 1.2k | Nov '14 |
Haskell upgrade? |
![]() ![]() ![]() |
2 | 1.1k | Oct '14 |