Data Structured65_q2a_no_move
2: Vector No Move
ee749af8-0617-4468-8c73-59564cb939de.cppC++
1// Loading code...Selected Submission
100 / 100
0.63s
8120 KB
ArrayOther
Time Comp.
O(log n) for operator[] due to upper_bound, O(1) for expand_hook
Space Comp.
O(n) for mData and O(k) for aux, where k is the number of segments
Readability
6/10
"The code implements a custom vector-like data structure that avoids moving elements when expanding capacity. It utilizes an auxiliary vector `aux` to keep track of segment boundaries, effectively creating a segmented array."
History
| Attempt | Points | Time ↓ |
|---|---|---|
| Try #6 | 100 | 10/6/2024 |
| Try #5 | 100 | 10/6/2024 |
| Try #4 | 0 | 10/6/2024 |
| Try #3 | 0 | 10/6/2024 |
| Try #2 | 0 | 10/6/2024 |
| Try #1 | 0 | 10/6/2024 |