vector<int> map[10001]; int main() { for (int i = 0; i < 3; i++) { int a, b; cin >> a >> b; map[a].push_back(b); } for (int i = 1; i <=3; i++) { for (int j : map[i]) cout << j << " "; cout << "\n"; } } --- 입력: 1 3 1 4 2 5 출력: 3 4 5 ---