Skip to content

Instantly share code, notes, and snippets.

@boxp
Created October 28, 2013 12:35
Show Gist options
  • Save boxp/7196083 to your computer and use it in GitHub Desktop.
Save boxp/7196083 to your computer and use it in GitHub Desktop.
ABC#2 3問目
(ns atcoder.core
(:use [clojure.string :only (join split split-lines)]))
; don't fix me
(defn gen-args
[input]
(split-lines input))
; start code section
(defn main
[args]
(let [input (vec (map #(js/parseInt % 10) (split (first args) " ")))]
(.log js/console
(/
(.abs js/Math
(+
(*
(input 0)
(-
(input 3)
(input 5)))
(*
(input 2)
(-
(input 5)
(input 1)))
(*
(input 4)
(-
(input 1)
(input 3)))))
2))))
; don't fix me
(defn ^:export debug
[]
(main
(gen-args
(.. js/document
(getElementById "input")
-value))))
; don't fix me
(set! *main-cli-fn*
(main
(gen-args
(.. (js/require "fs")
(readFileSync "/dev/stdin" "utf8")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment