結果

問題 No.1851 Regular Tiling
ユーザー 👑 colognecologne
提出日時 2022-02-25 21:34:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 492 ms / 2,000 ms
コード長 512 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 8,588 KB
最終ジャッジ日時 2023-09-16 16:14:44
合計ジャッジ時間 4,093 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 129 ms
8,420 KB
testcase_02 AC 152 ms
8,432 KB
testcase_03 AC 145 ms
8,468 KB
testcase_04 AC 137 ms
8,468 KB
testcase_05 AC 146 ms
8,572 KB
testcase_06 AC 163 ms
8,452 KB
testcase_07 AC 138 ms
8,588 KB
testcase_08 AC 141 ms
8,468 KB
testcase_09 AC 164 ms
8,568 KB
testcase_10 AC 149 ms
8,552 KB
testcase_11 AC 18 ms
7,772 KB
testcase_12 AC 18 ms
7,812 KB
testcase_13 AC 266 ms
8,508 KB
testcase_14 AC 492 ms
8,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    T = int(input())
    for i in range(T):
        h, w = map(int, input().split())

        def sub(x):
            if x % 3 == 2:
                return [1, 1, 0]*(x//3) + [1, 1]
            if x % 3 == 1:
                return [0] + [1, 1, 0]*(x//3)
            if x % 3 == 0:
                return [1, 1, 0]*(x//3)
        a = sub(h)
        b = sub(w)
        for i in a:
            for j in b:
                print(i+j, end=' ')
            print()


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