結果

問題 No.1130 Grid Numbers
ユーザー curryudon08curryudon08
提出日時 2021-02-23 20:31:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 872 bytes
コンパイル時間 987 ms
コンパイル使用メモリ 110,760 KB
実行使用メモリ 25,616 KB
最終ジャッジ日時 2023-10-23 21:24:15
合計ジャッジ時間 2,347 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
25,608 KB
testcase_01 AC 30 ms
25,616 KB
testcase_02 AC 30 ms
25,616 KB
testcase_03 AC 29 ms
25,464 KB
testcase_04 AC 30 ms
25,608 KB
testcase_05 AC 30 ms
25,616 KB
testcase_06 AC 31 ms
25,616 KB
testcase_07 AC 30 ms
25,612 KB
testcase_08 AC 31 ms
25,604 KB
testcase_09 AC 31 ms
25,616 KB
testcase_10 AC 31 ms
25,604 KB
testcase_11 AC 31 ms
25,604 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;

namespace _1130
{
    class Program
    {
        static void Main(string[] args)
        {
            var hw = Console.ReadLine().Split().Select(n => int.Parse(n)).ToArray();
            var s1 = new List<int>();

            for(var i = 0; i < hw[0]; i++){
                var a = Console.ReadLine().Split().Select(n => int.Parse(n.ToString())).ToArray();
                foreach(var m in a){
                    s1.Add(m);
                }
            }
            s1.Sort();
        
            for(var i = 0; i < hw[0]; i++){
                var s2 = new int[hw[1]];
                for(var j = 0; j < hw[1]; j++){
                    s2[j] = s1[i * hw[1] + j];
                }
                Console.WriteLine(string.Join(" ", s2.Select(c => c.ToString())));
            }
        }
    }
}
0