当前位置:网站首页>Cf:b. almost Terry matrix [symmetry + finding rules + structure + I am structural garbage]
Cf:b. almost Terry matrix [symmetry + finding rules + structure + I am structural garbage]
2022-07-05 18:59:00 【White speed Dragon King's review】


analysis
Tend to symmetry , Because it is 2 Multiple , So consider basic units 2 * 2
1 0 | 0 1
0 1 | 1 0
ABA…
BAB…
…
We have defined two special 2 * 2 Of A and B
Then it can be constructed AB Staggered appearance , Conform to the first and second examples
ac code
import sys
input = sys.stdin.readline
for _ in range(int(input())):
n, m = list(map(int, input().split()))
# 1 0 | 0 1
# 0 1 | 1 0
# ABA...
# BAB...
# ...
even = [1, 0, 0, 1]
odd = [0, 1, 1, 0]
ans = [[0] * m for _ in range(n)]
for i in range(n):
for j in range(m):
if i % 4 == 0 or i % 4 == 3:
ans[i][j] = even[j % 4]
else:
ans[i][j] = odd[j % 4]
for row in ans:
print(*row)
summary
I'm construction garbage
I'm looking for regular little garbage
边栏推荐
- 在通达信上做基金定投安全吗?
- Insufficient picture data? I made a free image enhancement software
- Ant group open source trusted privacy computing framework "argot": open and universal
- 2022 latest Android interview written examination, an Android programmer's interview experience
- 企业级数据安全,天翼云是这样理解的
- Emqx 5.0 officially released: a single cluster supports 100million mqtt connections
- 【历史上的今天】7 月 5 日:Google 之母出生;同一天诞生的两位图灵奖先驱
- Case sharing | integrated construction of data operation and maintenance in the financial industry
- You can have both fish and bear's paw! Sky wing cloud elastic bare metal is attractive!
- Oracle Chinese sorting Oracle Chinese field sorting
猜你喜欢

The road of enterprise digital transformation starts from here

How to quickly advance automated testing? Listen to the personal feelings of the three bat test engineers

怎么自动安装pythn三方库

AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务

How much does the mlperf list weigh when AI is named?

The era of Web3.0 is coming. See how Tianyi cloud storage resources revitalize the system to enable new infrastructure (Part 2)

Interprocess communication (IPC): shared memory

Idea configuring NPM startup

android中常见的面试题,2022金九银十Android大厂面试题来袭

Ant group open source trusted privacy computing framework "argot": open and universal
随机推荐
2022最新Android面试笔试,一个安卓程序员的面试心得
常见时间复杂度
EasyCVR授权到期页面无法登录,该如何解决?
AI open2022 | overview of recommendation systems based on heterogeneous information networks: concepts, methods, applications and resources
Applet modification style (placeholder, checkbox style)
一朵云开启智慧交通新未来
Tupu software digital twin | visual management system based on BIM Technology
[today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day
一文读懂简单查询代价估算
Interprocess communication (IPC): shared memory
ROS installation error sudo: rosdep: command not found
You can have both fish and bear's paw! Sky wing cloud elastic bare metal is attractive!
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
Use file and directory properties and properties
R language uses lubridate package to process date and time data
如何写出好代码 - 防御式编程
泰山OFFICE技术讲座:由行的布局高度,谈绘制高度的高度溢出、高度缩水(全网首发)
怎么自动安装pythn三方库
Solutions contents have differences only in line separators
2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions