結果

問題 No.1974 2x2 Flipper
ユーザー tamatotamato
提出日時 2022-06-10 22:10:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 722 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 81,688 KB
実行使用メモリ 85,456 KB
最終ジャッジ日時 2023-10-21 05:17:23
合計ジャッジ時間 5,489 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,484 KB
testcase_01 AC 58 ms
76,260 KB
testcase_02 AC 46 ms
64,064 KB
testcase_03 AC 101 ms
81,780 KB
testcase_04 AC 75 ms
78,160 KB
testcase_05 RE -
testcase_06 AC 87 ms
79,752 KB
testcase_07 AC 76 ms
78,364 KB
testcase_08 AC 51 ms
73,088 KB
testcase_09 AC 88 ms
80,196 KB
testcase_10 RE -
testcase_11 AC 79 ms
78,844 KB
testcase_12 AC 100 ms
81,904 KB
testcase_13 AC 86 ms
79,208 KB
testcase_14 AC 70 ms
77,592 KB
testcase_15 AC 111 ms
82,936 KB
testcase_16 RE -
testcase_17 AC 95 ms
80,620 KB
testcase_18 AC 52 ms
72,488 KB
testcase_19 AC 63 ms
76,004 KB
testcase_20 AC 72 ms
78,140 KB
testcase_21 AC 123 ms
85,380 KB
testcase_22 AC 133 ms
85,384 KB
testcase_23 AC 128 ms
85,456 KB
testcase_24 RE -
testcase_25 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

    H, W = map(int, input().split())
    H2 = H % 2
    W2 = W % 2
    if H2 == W2 == 0:
        print(H * W)
        ans = [[1] * W for _ in range(H)]
        for h in range(H):
            print(*ans[h])
    elif H2 == W2 == 1:
        assert False
    elif H2 == 1:
        print((H - 1) * W)
        ans = [[1] * W for _ in range(H)]
        ans[-1] = [0] * W
        for h in range(H):
            print(*ans[h])
    else:
        print(H * (W - 1))
        ans = [[1] * W for _ in range(H)]
        for h in range(H):
            ans[h][-1] = 0
        for h in range(H):
            print(*ans[h])


if __name__ == '__main__':
    main()
0