pair
pairをしっかり使えるようになりたいね。
typedef pair<int, int> P;
int a=1, b=2, c=3, d=4;
P x, y;
x=P(a, b);
y=P(c, d);
cout << x.first << " " << x.second << endl;
cout << y.first << " " << y.second << endl;
実行結果
1 2
3 4
重要
reverseだけするとバグるっぽいからsort→reverseってしましょう。