結果

問題 No.2112 All 2x2 are Equal
ユーザー 👑 kakel-sankakel-san
提出日時 2022-10-28 23:57:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 282 ms / 2,000 ms
コード長 920 bytes
コンパイル時間 1,400 ms
コンパイル使用メモリ 68,028 KB
実行使用メモリ 70,644 KB
最終ジャッジ日時 2023-09-20 07:17:48
合計ジャッジ時間 11,165 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
23,988 KB
testcase_01 AC 65 ms
21,808 KB
testcase_02 AC 70 ms
19,920 KB
testcase_03 AC 69 ms
21,968 KB
testcase_04 AC 149 ms
40,324 KB
testcase_05 AC 183 ms
53,584 KB
testcase_06 AC 269 ms
66,724 KB
testcase_07 AC 132 ms
45,792 KB
testcase_08 AC 234 ms
65,336 KB
testcase_09 AC 75 ms
24,356 KB
testcase_10 AC 142 ms
44,032 KB
testcase_11 AC 118 ms
41,480 KB
testcase_12 AC 122 ms
34,116 KB
testcase_13 AC 247 ms
66,112 KB
testcase_14 AC 72 ms
22,268 KB
testcase_15 AC 195 ms
53,932 KB
testcase_16 AC 65 ms
21,932 KB
testcase_17 AC 226 ms
62,344 KB
testcase_18 AC 69 ms
19,856 KB
testcase_19 AC 78 ms
24,680 KB
testcase_20 AC 71 ms
21,864 KB
testcase_21 AC 221 ms
59,868 KB
testcase_22 AC 73 ms
24,220 KB
testcase_23 AC 70 ms
21,860 KB
testcase_24 AC 82 ms
25,888 KB
testcase_25 AC 91 ms
28,856 KB
testcase_26 AC 84 ms
27,916 KB
testcase_27 AC 104 ms
28,764 KB
testcase_28 AC 155 ms
41,048 KB
testcase_29 AC 78 ms
27,212 KB
testcase_30 AC 127 ms
42,212 KB
testcase_31 AC 182 ms
48,188 KB
testcase_32 AC 282 ms
66,516 KB
testcase_33 AC 281 ms
68,616 KB
testcase_34 AC 280 ms
70,588 KB
testcase_35 AC 279 ms
70,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Program
{
    static long NN => long.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (h, w) = (c[0], c[1]);
        var res = new int[h][];
        for (var i = 0; i < res.Length; ++i) res[i] = new int[w];
        var num = 0;
        for (var i = 0; i < h; ++i) for (var j = 0; j < w; ++j)
        {
            if ((i + j) % 2 == 0) res[i][j] = ++num;
        }
        for (var i = h - 1; i >= 0; --i) for (var j = w - 1; j >= 0; --j)
        {
            if ((i + j) % 2 == 1) res[i][j] = ++num;
        }
        WriteLine("Yes");
        WriteLine(string.Join("\n", res.Select(r => string.Join(" ", r))));
    }
}
0