結果

問題 No.1851 Regular Tiling
ユーザー 👑 kakel-sankakel-san
提出日時 2023-11-29 22:45:34
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 1,181 bytes
コンパイル時間 7,758 ms
コンパイル使用メモリ 158,020 KB
実行使用メモリ 193,100 KB
最終ジャッジ日時 2023-11-29 22:45:47
合計ジャッジ時間 12,483 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
32,932 KB
testcase_01 AC 98 ms
36,516 KB
testcase_02 AC 98 ms
37,284 KB
testcase_03 AC 100 ms
37,028 KB
testcase_04 AC 98 ms
36,900 KB
testcase_05 AC 93 ms
37,028 KB
testcase_06 AC 100 ms
37,412 KB
testcase_07 AC 94 ms
36,772 KB
testcase_08 AC 94 ms
36,900 KB
testcase_09 AC 99 ms
37,412 KB
testcase_10 AC 100 ms
37,028 KB
testcase_11 AC 79 ms
33,060 KB
testcase_12 AC 80 ms
33,060 KB
testcase_13 AC 107 ms
40,356 KB
testcase_14 AC 133 ms
193,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (125 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var t = NN;
        var ans = new List<string>();
        var map = new int[][]
        {
            new int[] { 0, 1, 1 },
            new int[] { 1, 2, 2 },
            new int[] { 1, 2, 2 },
        };
        for (var u = 0; u < t; ++u)
        {
            var c = NList;
            var (h, w) = (c[0], c[1]);
            var hoffset = h % 3 == 2 ? 1 : 0;
            var woffset = w % 3 == 2 ? 1 : 0;
            for (var i = 0; i < h; ++i)
            {
                var sub = new int[w];
                for (var j = 0; j < w; ++j) sub[j] = map[(i + hoffset) % 3][(j + woffset) % 3];
                ans.Add(string.Join(" ", sub));
            }
        }
        WriteLine(string.Join("\n", ans));
    }
}
0