結果

問題 No.1130 Grid Numbers
ユーザー bluemeganebluemegane
提出日時 2021-04-18 10:07:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 797 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 65,388 KB
実行使用メモリ 14,620 KB
最終ジャッジ日時 2023-09-17 07:32:03
合計ジャッジ時間 2,633 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
14,572 KB
testcase_01 AC 61 ms
14,560 KB
testcase_02 AC 60 ms
14,528 KB
testcase_03 AC 57 ms
14,500 KB
testcase_04 AC 60 ms
14,588 KB
testcase_05 AC 60 ms
14,540 KB
testcase_06 AC 60 ms
14,620 KB
testcase_07 AC 60 ms
14,508 KB
testcase_08 AC 61 ms
14,552 KB
testcase_09 AC 61 ms
14,584 KB
testcase_10 AC 61 ms
14,612 KB
testcase_11 AC 61 ms
14,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    public static int h, w;
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        h = int.Parse(line[0]);
        w = int.Parse(line[1]);
        var t = new List<int>();
        for (int i = 0; i < h; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            for (int j = 0; j < w; j++) t.Add(int.Parse(line[j]));
        }
        getAns(t);
    }
    static void getAns(List<int> t)
    {
        t.Sort();
        var p = 0;
        var res = new int[w];
        for (int i = 0; i < h; i++)
        {
            for (int j = 0; j < w; j++) res[j] = t[j + p];
            Console.WriteLine(string.Join(" ", res));
            p += w;
        }
    }
}
0