結果

問題 No.1851 Regular Tiling
ユーザー kohei2019kohei2019
提出日時 2023-07-08 00:52:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 198 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 80,324 KB
最終ジャッジ日時 2023-09-29 02:25:07
合計ジャッジ時間 4,355 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,416 KB
testcase_01 AC 135 ms
78,064 KB
testcase_02 AC 136 ms
78,072 KB
testcase_03 AC 132 ms
78,028 KB
testcase_04 AC 130 ms
77,896 KB
testcase_05 AC 131 ms
77,768 KB
testcase_06 AC 138 ms
78,396 KB
testcase_07 AC 126 ms
78,000 KB
testcase_08 AC 133 ms
77,808 KB
testcase_09 AC 141 ms
78,020 KB
testcase_10 AC 130 ms
78,000 KB
testcase_11 AC 95 ms
76,728 KB
testcase_12 AC 85 ms
76,672 KB
testcase_13 AC 160 ms
78,808 KB
testcase_14 AC 198 ms
80,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
SQ = [[0,1,1],[1,2,2],[1,2,2],[0,1,1]]
mm = [0,0,1]
for i in range(T):
    H,W = map(int,input().split())
    ans = [[0]*W for j in range(H)]
    x = mm[H%3]
    y = mm[W%3]
    for j in range(H):
        for k in range(W):
            ans[j][k] = SQ[(x+j)%3][(y+k)%3]
    for j in range(H):
        print(*ans[j],sep=' ')
0