Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include <iostream>
- //#include <vector>
- //#include <set>
- //#include <map>
- //#include <string>
- //#include <unordered_map>
- //#include <optional>
- //
- //using namespace std;
- //
- //int main()
- //{
- // //vector<int> numbers = { 3,7,5,6,20,4,22,17,9 };
- // set<int> numbers = { 3,7,5,6,20,4,22,17,9 };
- // auto it = std::find(begin(numbers), end(numbers),4);
- // /**it = 21;*/
- //
- // const int& p = *it;
- //
- // for (auto x : numbers)
- // {
- // cout << x << ' ';
- // }
- //
- // return 0;
- //}
- //#include <iostream>
- //#include <algorithm>
- //#include <vector>
- //#include <set>
- //#include <map>
- //#include <string>
- //#include <unordered_map>
- //#include <optional>
- //
- //using namespace std;
- //
- //vector<int> Sorted(vector<int> data)
- //{
- // sort(begin(data), end(data));
- //}
- //int main()
- //{
- // const vector<int> sorted_numbers = Sorted({ 5,4,2,1,5,1,3,4,5,6,8 });
- //
- //
- // for (int x : sorted_numbers)
- // {
- // cout << x << ' ';
- // }
- //
- // ProcessNumbersOne(sorted_numbers);
- // ProcessNumbersTwo(sorted_numbers);
- // ProcessNumbersThree(sorted_numbers);
- //
- //
- // int n;
- // cin >> n;
- //
- // for (int i = 0; i < n; ++i)
- // {
- // int x;
- // cin >> x;
- // cout << x << ' ';
- // cout << std::binary_search(begin(sorted_numbers), end(sorted_numbers), x) << '\n';
- // }
- //
- // return 0;
- //}
- //Константность в С++ позволяет поддерживать инварианты в классах и объектах
- /////////////////////////
- //#include <iostream>
- //#include <algorithm>
- //#include <vector>
- //#include <set>
- //#include <map>
- //#include <string>
- //#include <unordered_map>
- //#include <optional>
- //
- //using namespace std;
- //
- //vector<int> Sorted(vector<int> data)
- //{
- // sort(begin(data), end(data));
- //}
- //
- ////vector<int> Unique(vector<int> data)
- ////{
- //// auto it =unique(begin(data), end(data));
- //// data.erase(it, end(data));
- ////
- //// return data;
- ////}
- //
- //
- //int main()
- //{
- // //const vector<int> sorted_numbers = Sorted({ 5,4,2,1,5,1,3,4,5,6,8 });
- // /*const vector<int> sorted_numbers = [] {vector<int> data = Sorted({ 5,4,2,1,5,1,3,4,5,6,8 });
- //
- // auto it = unique(begin(data), end(data));
- // data.erase(it, end(data));
- // return data;
- // }();
- //
- // for (int x : sorted_numbers)
- // {
- // cout << x << ' ';
- // }*/
- //
- // const vector<int> sorted_numbers = [] {LOG_DURATION("Sorted numbers build");
- // return Sorted(
- // { 5,4,2,1,5,1,3,4,5,6,8 }
- // );
- // }();
- //
- //
- //
- //
- // return 0;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement