回答編集履歴
3
修正
answer
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
using P1 = std::pair<int, int>;
|
14
14
|
|
15
15
|
struct P2 {
|
16
|
-
P2(int
|
16
|
+
P2(int y, int x) : y(y), x(x)
|
17
17
|
{
|
18
18
|
}
|
19
19
|
|
2
修正
answer
CHANGED
@@ -19,6 +19,7 @@
|
|
19
19
|
|
20
20
|
bool operator<(const P2 &rhs) const
|
21
21
|
{
|
22
|
+
// y の値を優先してソートするなら
|
22
23
|
return y != rhs.y ? y < rhs.y : x < rhs.x;
|
23
24
|
}
|
24
25
|
|
1
修正
answer
CHANGED
@@ -37,8 +37,8 @@
|
|
37
37
|
s1.emplace(y, x);
|
38
38
|
s2.emplace(y, x);
|
39
39
|
|
40
|
-
for (const auto &
|
40
|
+
for (const auto &point : s2)
|
41
|
-
std::cout << "(y, x) = " <<
|
41
|
+
std::cout << "(y, x) = " << point.y << "," << point.x << std::endl;
|
42
42
|
}
|
43
43
|
|
44
44
|
```
|