/* >>455 */
#include <iostream>
#include <vector>
#include <algorithm>
#include <chrono>
using namespace std;
int main()
{
vector< vector<int> > arr {
{1,5,3,4},
{0,4,1,0},
{7,2,3,1}
};
const auto start = chrono::system_clock::now();
for (auto& row : arr)
sort( row.begin(), row.end() );
sort( arr.begin(), arr.end() );
const chrono::duration<double> elapsed = chrono::system_clock::now() - start;
/* results. */
for (auto& row : arr)
{
for (auto& col : row)
cout << col << ", ";
cout << endl;
}
cout << elapsed.count() << " sec." << endl;
return 0;
}
LyogPj40NTUgKi8KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8Y2hyb25vPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkKewoJdmVjdG9yPCB2ZWN0b3I8aW50PiA+IGFyciB7CgkJezEsNSwzLDR9LAoJCXswLDQsMSwwfSwKCQl7NywyLDMsMX0KCX07Cgljb25zdCBhdXRvIHN0YXJ0ID0gY2hyb25vOjpzeXN0ZW1fY2xvY2s6Om5vdygpOwoJCQoJZm9yIChhdXRvJiByb3cgOiBhcnIpCgkJc29ydCggcm93LmJlZ2luKCksIHJvdy5lbmQoKSApOwoJc29ydCggYXJyLmJlZ2luKCksIGFyci5lbmQoKSApOwoJCgljb25zdCBjaHJvbm86OmR1cmF0aW9uPGRvdWJsZT4gZWxhcHNlZCA9IGNocm9ubzo6c3lzdGVtX2Nsb2NrOjpub3coKSAtIHN0YXJ0OwoKCS8qIHJlc3VsdHMuICovCglmb3IgKGF1dG8mIHJvdyA6IGFycikKCXsKCQlmb3IgKGF1dG8mIGNvbCA6IHJvdykKCQkJY291dCA8PCBjb2wgPDwgIiwgIjsKCQljb3V0IDw8IGVuZGw7Cgl9Cgljb3V0IDw8IGVsYXBzZWQuY291bnQoKSA8PCAiIHNlYy4iIDw8IGVuZGw7CglyZXR1cm4gMDsKfQ==
0, 0, 1, 4,
1, 2, 3, 7,
1, 3, 4, 5,
1.942e-06 sec.