Submission #1842067


Source Code Expand

(let* ((n (read))
       (a (make-array n))
       (total 0))
  (dotimes (i n)
    (setf (aref a i) (read)))
  (dotimes (i n)
    (let ((c (aref a i))
          (left 0)
          (right 0))
      (loop for l from i downto 0
            for v = (aref a l)
            until (< v c) do
            (incf left))
      (loop for r from i below n
            for v = (aref a r)
            until (< v c) do
            (incf right))
      (incf total (* c left right))))
  (format t "~A~%" total))

Submission Info

Submission Time
Task B - Minimum Sum
User tamamu
Language Common Lisp (SBCL 1.1.14)
Score 0
Code Size 511 Byte
Status TLE
Exec Time 2105 ms
Memory 59752 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 10
TLE × 3
Set Name Test Cases
Sample example0, example1, example2
All corner0, corner1, corner2, corner3, example0, example1, example2, maxrand0, maxrand1, maxrand2, rand0, rand1, rand2
Case Name Status Exec Time Memory
corner0 TLE 2105 ms 59748 KB
corner1 TLE 2105 ms 59752 KB
corner2 AC 23 ms 6500 KB
corner3 TLE 2105 ms 59752 KB
example0 AC 23 ms 6500 KB
example1 AC 22 ms 6496 KB
example2 AC 23 ms 6500 KB
maxrand0 AC 419 ms 59752 KB
maxrand1 AC 421 ms 59744 KB
maxrand2 AC 422 ms 59748 KB
rand0 AC 23 ms 6496 KB
rand1 AC 23 ms 6504 KB
rand2 AC 23 ms 6496 KB