Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
101958 Tom0 矩阵排序 C++ Accepted 100 44 MS 1252 KB 513 2023-09-11 15:17:34

Tests(10/10):


#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; }


Judgement Protocol: