diff --git a/codeforces_rollbacks.cpp b/codeforces_rollbacks.cpp new file mode 100644 index 0000000..85cd7aa --- /dev/null +++ b/codeforces_rollbacks.cpp @@ -0,0 +1,114 @@ +#include +using namespace std; + + +void display(vector temp) +{ + int si = temp.size(); + for (int m=0;m new_temp) + +{ + vector new_temp1 = new_temp; + sort(new_temp1.begin(),new_temp1.end()); + + auto it = unique(new_temp1.begin(), new_temp1.end()); + + new_temp1.resize(distance(new_temp1.begin(), it)); + cout< main_arr= {}; + vector copy_arr = {}; + int q=0; + cout<<"NUM OF QUERIES : "; + cin>>q; + + for (int i=0;i>input; + + if (input=="?") + { + distinct(main_arr); + + // int answer = distinct(main_arr); + // cout<0) + { + main_arr.push_back(test); + + } + + else + { + + for (int temporary=0;temporary