結果

問題 No.1130 Grid Numbers
ユーザー a
提出日時 2021-10-31 18:20:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 6,802 ms
コンパイル使用メモリ 411,404 KB
最終ジャッジ日時 2025-01-25 10:04:03
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace atcoder;
using namespace boost::multiprecision;

void solve() {
    int H, W;
    cin >> H >> W;
    vector<int> A(H * W);
    for (int i = 0; i < (H * W); i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end());
    for (int i = 0; i < (H * W); i++) {
        cout << A[i] << ((i + 1) % W == 0 ? '\n' : ' ');
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
    return 0;
}
0