結果
| 問題 | No.1130 Grid Numbers |
| ユーザー |
|
| 提出日時 | 2020-08-02 12:11:30 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 876 bytes |
| 記録 | |
| コンパイル時間 | 1,820 ms |
| コンパイル使用メモリ | 83,772 KB |
| 実行使用メモリ | 127,516 KB |
| 最終ジャッジ日時 | 2026-04-02 02:49:46 |
| 合計ジャッジ時間 | 3,022 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
import java.io.*;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] line = br.readLine().split(" ");
int h = Integer.parseInt(line[0]), w = Integer.parseInt(line[1]);
ArrayList<Integer> arr = new ArrayList<Integer>(h * w);
for (int i = 0; i < h; i++) {
line = br.readLine().split(" ");
for (int j = 0; j < w; j++) {
arr.add(Integer.parseInt(line[j]));
}
}
arr.sort(null);
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (j > 0) System.out.print(" ");
System.out.print(arr.get(i * w + j));
}
System.out.println();
}
}
}