結果

問題 No.1851 Regular Tiling
ユーザー ああいいああいい
提出日時 2022-02-25 22:42:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 1,112 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 78,664 KB
最終ジャッジ日時 2023-09-16 17:53:35
合計ジャッジ時間 4,014 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,308 KB
testcase_01 AC 117 ms
77,552 KB
testcase_02 AC 107 ms
77,364 KB
testcase_03 AC 113 ms
77,528 KB
testcase_04 AC 114 ms
77,716 KB
testcase_05 AC 114 ms
77,888 KB
testcase_06 AC 119 ms
78,004 KB
testcase_07 AC 113 ms
77,704 KB
testcase_08 AC 114 ms
77,552 KB
testcase_09 AC 119 ms
77,916 KB
testcase_10 AC 113 ms
77,424 KB
testcase_11 AC 99 ms
76,836 KB
testcase_12 AC 80 ms
76,592 KB
testcase_13 AC 138 ms
77,708 KB
testcase_14 AC 163 ms
78,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

l1 = [[0,1,1],
      [1,2,2],
      [1,2,2]]
l2 = [[1,1,0],
      [2,2,1],
      [2,2,1,]]
l3 = [[2,2,1],
      [2,2,1],
      [1,1,0]]
l4 = [[1,2,2,],
      [1,2,2,],
      [0,1,1,]]
d = [[l1,l4,l2],
     [l1,l1,l2],
     [l3,l4,l3]]
for _ in range(T):
    H,W = map(int,input().split())
    h = H % 3
    w = W % 3
    l = d[h][w]
    for h in range(H):
        for w in range(W):
            print(l[h%3][w%3],end = " ")
        print()
0