結果

問題 No.1851 Regular Tiling
ユーザー ygd.ygd.
提出日時 2022-02-27 19:40:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 187 ms / 2,000 ms
コード長 1,069 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 78,844 KB
最終ジャッジ日時 2023-09-19 06:54:39
合計ジャッジ時間 4,440 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
76,164 KB
testcase_01 AC 128 ms
77,892 KB
testcase_02 AC 131 ms
77,776 KB
testcase_03 AC 129 ms
77,944 KB
testcase_04 AC 127 ms
77,772 KB
testcase_05 AC 128 ms
77,944 KB
testcase_06 AC 129 ms
78,096 KB
testcase_07 AC 124 ms
77,592 KB
testcase_08 AC 126 ms
77,860 KB
testcase_09 AC 130 ms
77,904 KB
testcase_10 AC 133 ms
77,764 KB
testcase_11 AC 93 ms
76,588 KB
testcase_12 AC 92 ms
76,764 KB
testcase_13 AC 145 ms
78,652 KB
testcase_14 AC 187 ms
78,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]

A = []
MAX = 110
for i in range(MAX):
    temp = []
    for j in range(MAX):
        if i%3 == j%3 == 0:
            v = 0
        elif i%3 == 0 or j %3 == 0:
            v = 1
        else:
            v = 2
        temp.append(v)
    A.append(temp)
#print(A)

def main():
    T = int(input())
    for _ in range(T):
        H,W = map(int,input().split())
        if H%3 == 2:
            a = 1
        else:
            a = 0
        if W%3 == 2:
            b = 1
        else:
            b = 0
        for i in range(H):
            #print(a,b)
            print(*A[i+a][b:b+W])

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