結果

問題 No.1974 2x2 Flipper
ユーザー 👑 kakel-sankakel-san
提出日時 2022-06-10 23:45:41
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,334 bytes
コンパイル時間 3,985 ms
コンパイル使用メモリ 111,292 KB
実行使用メモリ 42,148 KB
最終ジャッジ日時 2023-10-21 05:52:09
合計ジャッジ時間 6,968 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
25,620 KB
testcase_01 AC 43 ms
30,220 KB
testcase_02 AC 31 ms
25,612 KB
testcase_03 AC 116 ms
37,884 KB
testcase_04 AC 71 ms
32,544 KB
testcase_05 WA -
testcase_06 AC 95 ms
34,508 KB
testcase_07 AC 68 ms
32,780 KB
testcase_08 AC 37 ms
27,644 KB
testcase_09 AC 88 ms
34,940 KB
testcase_10 WA -
testcase_11 AC 78 ms
33,832 KB
testcase_12 AC 118 ms
37,132 KB
testcase_13 AC 80 ms
33,744 KB
testcase_14 AC 59 ms
31,888 KB
testcase_15 AC 120 ms
38,200 KB
testcase_16 WA -
testcase_17 AC 99 ms
35,332 KB
testcase_18 AC 37 ms
27,656 KB
testcase_19 AC 38 ms
27,660 KB
testcase_20 AC 66 ms
32,372 KB
testcase_21 AC 157 ms
42,148 KB
testcase_22 AC 158 ms
42,128 KB
testcase_23 AC 155 ms
42,140 KB
testcase_24 AC 158 ms
42,136 KB
testcase_25 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

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 void Main()
    {
        var c = NList;
        var (h, w) = (c[0], c[1]);
        var res = new int[h][];
        var count = 0;
        for (var i = 0; i < h; ++i)
        {
            res[i] = Enumerable.Repeat(1, w).ToArray();
        }
        if (h % 2 == 0 && w % 2 == 0)
        {
            count = h * w;
        }
        else if (h % 2 == 0)
        {
            for (var i = 0; i < h; ++i) res[i][w - 1] = 0;
            count = h * (w - 1);
        }
        else if (w % 2 == 0)
        {
            for (var j = 0; j < w; ++j) res[h - 1][j] = 0;
            count = (h - 1) * w;
        }
        else if (h <= w)
        {
            for (var i = 0; i < h; ++i) res[i][i] = 0;
            for (var i = h; i < w; ++i) res[h - 1][i] = 0;
            count = h * (w - 1);
        }
        else
        {
            for (var i = 0; i < w; ++i) res[i][i] = 0;
            for (var i = w; i < h; ++i) res[i][w - 1] = 0;
            count = (h - 1) * w;
        }
        WriteLine(count);
        WriteLine(string.Join("\n", res.Select(r => string.Join(" ", r))));
    }
}
0