Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
101958 | Tom0 | 矩阵排序 | C++ | 通过 | 100 | 44 MS | 1252 KB | 513 | 2023-09-11 15:17:34 |
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, m; cin >> n >> m; vector<vector<int>> matrix(n, vector<int>(m)); for(int i = 0; i < n; ++i) for(int j = 0; j < m; ++j) cin >> matrix[i][j]; sort(matrix.begin(), matrix.end()); for(const auto &row : matrix) { for(const auto &num : row) cout << num << ' '; cout << '\n'; } return 0; }