Submission #54993981
Source Code Expand
Copy
let str_to_int_step value ch =let ch_str = String.make 1 chin value * 10 + (String.get_uint8 ch_str 0) - 48;;let str_to_int s = String.fold_left str_to_int_step 0 s;;let rec sum_list l s =match l with| [] -> s| x :: xs -> sum_list xs (s + (str_to_int x));;let line1 = read_line ();;let line2 = read_line ();;let line3 = read_line ();;let bc_str = String.split_on_char (String.get " " 0) line2;;let a = str_to_int line1;;let sum = sum_list bc_str a;;
let str_to_int_step value ch = let ch_str = String.make 1 ch in value * 10 + (String.get_uint8 ch_str 0) - 48 ;; let str_to_int s = String.fold_left str_to_int_step 0 s;; let rec sum_list l s = match l with | [] -> s | x :: xs -> sum_list xs (s + (str_to_int x)) ;; let line1 = read_line ();; let line2 = read_line ();; let line3 = read_line ();; let bc_str = String.split_on_char (String.get " " 0) line2;; let a = str_to_int line1;; let sum = sum_list bc_str a;; let result_str = (Int.to_string sum) ^ " " ^ line3;; print_endline result_str;;
Submission Info
Submission Time | |
---|---|
Task | PracticeA - Welcome to AtCoder |
User | mikecat |
Language | OCaml (ocamlopt 5.0.0) |
Score | 100 |
Code Size | 585 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 4220 KB |
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 | 1 ms | 4036 KB |
00_rnd_02.txt | AC | 1 ms | 4220 KB |
00_rnd_03.txt | AC | 1 ms | 4088 KB |
00_rnd_04.txt | AC | 1 ms | 4092 KB |
00_rnd_05.txt | AC | 1 ms | 4040 KB |
00_sample_1.txt | AC | 1 ms | 4012 KB |
00_sample_2.txt | AC | 1 ms | 4092 KB |