結果

問題 No.1130 Grid Numbers
ユーザー xRS43BofaUEZ5gc
提出日時 2021-03-04 10:01:21
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 67 ms / 2,000 ms
+ 364µs
コード長 747 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,268 ms
コンパイル使用メモリ 86,628 KB
実行使用メモリ 43,432 KB
最終ジャッジ日時 2026-09-10 04:36:04
合計ジャッジ時間 4,212 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.Arrays;
import java.util.Scanner;

public class HelloWorld {

	    public static void main(String[] args) throws Exception {

	    	Scanner sc = new Scanner(System.in);
	    	int number_rows = sc.nextInt();
	    	int number_columns = sc.nextInt();
	    	int[] data = new int[number_columns * number_rows];
	    	for (int i = 0; i < number_rows * number_columns; i ++) {
	    		data[i] = sc.nextInt();
	    	}

	    	Arrays.sort(data);

	    	for (int i = 0; i < number_rows; i++) {
	    		for (int j = 0; j < number_columns; j++) {
	    			System.out.print(data[i * number_columns + j]);
	    			if (j != number_columns - 1) {
	    				System.out.print(" ");
	    			}
	    		}
	    		System.out.println("");
	    	}

	    	}



}
0