From 4c5ed94087a691ce47882786aea64f7b5bf3c130 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 20 Oct 2018 11:27:47 +0700 Subject: Bon appétit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codechef/bitobyt.lisp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 codechef/bitobyt.lisp (limited to 'codechef/bitobyt.lisp') diff --git a/codechef/bitobyt.lisp b/codechef/bitobyt.lisp new file mode 100644 index 0000000..6a26b93 --- /dev/null +++ b/codechef/bitobyt.lisp @@ -0,0 +1,10 @@ +(let ((tests (read))) + (dotimes (i tests) + (let ((n (read))) + (if (= n 0) + (format t "1 0 0~&") + (multiple-value-bind (d m) (truncate (1- n) 26) + (format t (cond ((< m 2) "~a 0 0~&") + ((< m 10) "0 ~a 0~&") + (t "0 0 ~a~&")) + (expt 2 d))))))) -- cgit 1.4.1