Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <iterator>
- #include <vector>
- using namespace std;
- int main() {
- int n;
- cin>>n;
- vector <int> v(n);
- copy_n (istream_iterator <int> (cin), n, v.begin());
- cout<<*find_if (v.begin(), v.end(), [v](int &el){
- return count (v.begin(), v.end(), el) == 1;
- });
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment