Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef pair <int,int> point;
- bool comparator(point a , point b)
- {
- return a.second % 2 == 0 && b.second % 2 != 0 ;
- }
- int main()
- {
- int n ;
- cin >> n ;
- vector <point> a ;
- for (int i = 0 ; i < n ; i ++)
- {
- int x = 1;
- int y ;
- cin >> y ;
- a.push_back({x , y}) ;
- }
- sort(a.begin(), a.end(), comparator) ;
- for (int i = 0; i < n ; i ++)
- cout << a[i].first << " " << a[i].second << endl ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement