結果
| 問題 | 
                            No.1130 Grid Numbers
                             | 
                    
| ユーザー | 
                             tnakao0123
                         | 
                    
| 提出日時 | 2020-07-30 23:35:53 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 895 bytes | 
| コンパイル時間 | 824 ms | 
| コンパイル使用メモリ | 97,404 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-04 23:41:06 | 
| 合計ジャッジ時間 | 1,487 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 12 | 
ソースコード
/* -*- coding: utf-8 -*-
 *
 * 1130.cc:  No.1130 Grid Numbers - yukicoder
 */
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;
/* constant */
const int MAX_H = 100;
const int MAX_W = 100;
const int MAX_N = MAX_H * MAX_W;
/* typedef */
/* global variables */
int as[MAX_N];
/* subroutines */
/* main */
int main() {
  int h, w;
  scanf("%d%d", &h, &w);
  int n = h * w;
  for (int i = 0; i < n; i++) scanf("%d", as + i);
  sort(as, as + n);
  for (int i = 0, p = 0; i < h; i++)
    for (int j = 0; j < w; j++, p++) {
      printf("%d", as[p]);
      putchar(j + 1 < w ? ' ' : '\n');
    }
  return 0;
}
            
            
            
        
            
tnakao0123