結果

問題 No.1130 Grid Numbers
ユーザー UGLO
提出日時 2020-08-23 18:01:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 1,781 ms
コンパイル使用メモリ 171,064 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 18:50:39
合計ジャッジ時間 2,455 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)

int main(){
    int h,w; cin >> h >> w;
    vector<int> a(h*w);
    rep(i,h*w) cin >> a[i];
    sort(a.begin(),a.end());
    rep(i,h){
        rep(j,w){
            if(j!=w-1)cout << a[i*w+j] << " ";
            else cout << a[i*w+j];
        }
        cout << endl;
    }
}
0