2 条题解
-
0
#include <bits/stdc++.h> using namespace std; int main() { int n, m, x, y; cin >> n >> m; map<int, vector<int>> arr; for (int i = 0; i < m; i++) { cin >> x >> y; arr[x].push_back(y); } for (auto &ele : arr) { sort(ele.second.begin(), ele.second.end()); } for (int i = 1; i <= n; i++) { cout << arr[i].size(); for (auto &num : arr[i]) { cout << " " << num; } cout << endl; } return 0; }
信息
- ID
- 72
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 4
- 标签
- 递交数
- 296
- 已通过
- 137
- 上传者