diff options
| author | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-11-16 01:24:14 +0100 |
|---|---|---|
| committer | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-11-16 01:24:14 +0100 |
| commit | 98567ec798aa8ca2cfbcb85c774dd470f30e30d4 (patch) | |
| tree | 5113d5cc24d1ad5f93810b6442ce584a36950dc8 /datastructures/persistent.cpp | |
| parent | ad3856a6b766087df0036de0b556f4700a6498c9 (diff) | |
| parent | 8d11c6c8213f46f0fa19826917c255edd5d43cb1 (diff) | |
mzuenni tests
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;
- }
-};
|
