Submission #54934058
Source Code Expand
Copy
(defn process [a b c s status](let [ch (IO.Raw.get-char)](cond(= status 1)(if (= ch (clamp 48 57 ch))(process (+ (* a 10) (- ch 48)) b c s 1)(process a b c s 2))(= status 2)(if (= ch (clamp 48 57 ch))(process a (+ (* b 10) (- ch 48)) c s 2)(process a b c s 3))(= status 3)(if (= ch (clamp 48 57 ch))(process a b (+ (* c 10) (- ch 48)) s 3)(process a b c s 4))(if (= ch 10)[(Int.prn (+ (+ a b) c)) (String.from-chars &s)](process a b c (Array.push-back s (Char.from-int ch)) 4)
(defn process [a b c s status]
(let [ch (IO.Raw.get-char)]
(cond
(= status 1)
(if (= ch (clamp 48 57 ch))
(process (+ (* a 10) (- ch 48)) b c s 1)
(process a b c s 2)
)
(= status 2)
(if (= ch (clamp 48 57 ch))
(process a (+ (* b 10) (- ch 48)) c s 2)
(process a b c s 3)
)
(= status 3)
(if (= ch (clamp 48 57 ch))
(process a b (+ (* c 10) (- ch 48)) s 3)
(process a b c s 4)
)
(if (= ch 10)
[(Int.prn (+ (+ a b) c)) (String.from-chars &s)]
(process a b c (Array.push-back s (Char.from-int ch)) 4)
)
)
)
)
(def result (process 0 0 0 [(Char.from-int 32)] 1))
(def result2 (String.concat &result))
(IO.println &result2)
Submission Info
| Submission Time | |
|---|---|
| Task | PracticeA - Welcome to AtCoder |
| User | mikecat |
| Language | Carp (Carp 0.5.5) |
| Score | 100 |
| Code Size | 813 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 2028 KB |
Compile Error
[RUNTIME ERROR] 'out/Untitled' exited with return value -11. bash: line 2: 2 Segmentation fault (core dumped) carp -b --optimize Main.carp 1>&2
Judge Result
| Set Name | All | ||
|---|---|---|---|
| Score / Max Score | 100 / 100 | ||
| Status |
|
| Set Name | Test Cases |
|---|---|
| All | 00_rnd_01.txt, 00_rnd_02.txt, 00_rnd_03.txt, 00_rnd_04.txt, 00_rnd_05.txt, 00_sample_1.txt, 00_sample_2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_rnd_01.txt | AC | 0 ms | 1932 KB |
| 00_rnd_02.txt | AC | 0 ms | 1932 KB |
| 00_rnd_03.txt | AC | 0 ms | 1960 KB |
| 00_rnd_04.txt | AC | 0 ms | 2028 KB |
| 00_rnd_05.txt | AC | 0 ms | 2024 KB |
| 00_sample_1.txt | AC | 1 ms | 2020 KB |
| 00_sample_2.txt | AC | 0 ms | 1896 KB |