結果

問題 No.1851 Regular Tiling
ユーザー 👑 KazunKazun
提出日時 2022-02-25 22:01:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 78,668 KB
最終ジャッジ日時 2024-07-03 16:54:21
合計ジャッジ時間 3,615 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline

T=int(input())
for _ in range(T):
    H,W=map(int,input().split())

    if H%3==0 or H%3==1:
        alpha=0
    else:
        alpha=2

    if W%3==0 or W%3==1:
        beta=0
    else:
        beta=2

    for i in range(H):
        print(*[(i%3!=alpha)+(j%3!=beta) for j in range(W)])
0