diff options
Diffstat (limited to 'datastructures/persistent.cpp')
| -rw-r--r-- | datastructures/persistent.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/datastructures/persistent.cpp b/datastructures/persistent.cpp deleted file mode 100644 index 4093cdc..0000000 --- a/datastructures/persistent.cpp +++ /dev/null @@ -1,18 +0,0 @@ -template<typename T>
-struct persistent {
- int& time;
- vector<pair<int, T>> data;
-
- persistent(int& time, T value = {})
- : time(time), data(1, {time, value}) {}
-
- T get(int t) {
- return prev(upper_bound(all(data), pair{t+1, T{}}))->second;
- }
-
- int set(T value) {
- time += 2;
- data.push_back({time, value});
- return time;
- }
-};
|
