Submission #3236693
Source Code Expand
let () = Scanf.scanf "%d\n" @@ fun n -> let lrs = Array.init n @@ fun _ -> Scanf.scanf "%d %d\n" @@ fun l r -> l, r in let f x = Array.fold_right (fun (l, r) -> ( + ) @@ if x < l then l - x else if r < x then x - r else 0) lrs 0 in let l = Array.fold_right (fun (l, _) -> min l) lrs max_int in let r = Array.fold_right (fun (_, r) -> max r) lrs min_int in Printf.printf "%d\n" @@ Array.fold_left min max_int @@ Array.init (r - l + 1) @@ fun i -> f @@ i + l
Submission Info
Submission Time | |
---|---|
Task | E - NarrowRectangles |
User | fetburner |
Language | OCaml (4.02.3) |
Score | 0 |
Code Size | 494 Byte |
Status | RE |
Exec Time | 70 ms |
Memory | 6656 KB |
Judge Result
Set Name | Sample | Subtask | All | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | 0 / 700 | ||||||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 0_004.txt |
Subtask | 0_000, 0_001, 0_004, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 0_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 2_018.txt, 2_019.txt, 2_020.txt, 2_021.txt, 2_022.txt, 2_023.txt, 2_024.txt, 2_025.txt, 2_026.txt, 2_027.txt, 2_028.txt, 2_029.txt, 2_030.txt, 2_031.txt, 2_032.txt, 2_033.txt, 2_034.txt, 2_035.txt, 2_036.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 1 ms | 384 KB |
0_001.txt | AC | 1 ms | 384 KB |
0_002.txt | RE | 1 ms | 384 KB |
0_003.txt | RE | 1 ms | 384 KB |
0_004.txt | AC | 1 ms | 384 KB |
1_005.txt | AC | 4 ms | 2560 KB |
1_006.txt | WA | 4 ms | 2560 KB |
1_007.txt | AC | 4 ms | 2560 KB |
1_008.txt | WA | 4 ms | 2560 KB |
1_009.txt | WA | 4 ms | 2560 KB |
1_010.txt | WA | 4 ms | 2560 KB |
1_011.txt | WA | 4 ms | 2560 KB |
1_012.txt | WA | 4 ms | 4608 KB |
1_013.txt | WA | 4 ms | 2560 KB |
1_014.txt | WA | 4 ms | 2560 KB |
1_015.txt | WA | 4 ms | 2560 KB |
1_016.txt | WA | 4 ms | 2560 KB |
1_017.txt | WA | 4 ms | 2560 KB |
2_018.txt | RE | 58 ms | 6144 KB |
2_019.txt | RE | 57 ms | 6528 KB |
2_020.txt | RE | 58 ms | 6144 KB |
2_021.txt | RE | 68 ms | 6144 KB |
2_022.txt | RE | 68 ms | 6144 KB |
2_023.txt | RE | 67 ms | 6656 KB |
2_024.txt | RE | 67 ms | 6144 KB |
2_025.txt | RE | 68 ms | 6144 KB |
2_026.txt | RE | 67 ms | 6144 KB |
2_027.txt | RE | 67 ms | 6144 KB |
2_028.txt | RE | 66 ms | 6144 KB |
2_029.txt | RE | 68 ms | 6272 KB |
2_030.txt | RE | 67 ms | 6272 KB |
2_031.txt | RE | 69 ms | 6144 KB |
2_032.txt | RE | 68 ms | 6656 KB |
2_033.txt | RE | 67 ms | 6144 KB |
2_034.txt | RE | 67 ms | 6144 KB |
2_035.txt | RE | 70 ms | 6400 KB |
2_036.txt | RE | 67 ms | 6528 KB |