当前位置:网站首页>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
边栏推荐
- 《ClickHouse原理解析与应用实践》读书笔记(5)
- 2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目
- RedHat7.4配置yum软件仓库(RHEL7.4)
- Is it complicated to open an account? Is online account opening safe?
- Postman核心功能解析 —— 参数化和测试报告
- android中常见的面试题,2022金九银十Android大厂面试题来袭
- The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly
- Mathematical modeling of oil pipeline layout MATLAB, mathematical model of oil pipeline layout
- Chinese postman? Really powerful!
- Web3.0时代来了,看天翼云存储资源盘活系统如何赋能新基建(下)
猜你喜欢
Low code practice of xtransfer, a cross-border payment platform: how to integrate with other medium-sized platforms is the core
AI Open2022|基于异质信息网络的推荐系统综述:概念,方法,应用与资源
瞅一瞅JUC提供的限流工具Semaphore
进程间通信(IPC):共享内存
集合处理的利器
企业级数据安全,天翼云是这样理解的
技术分享 | 常见接口协议解析
Thoroughly understand why network i/o is blocked?
跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心
视频自监督学习综述
随机推荐
Take a look at semaphore, the current limiting tool provided by JUC
2022 latest intermediate and advanced Android interview questions, [principle + practice + Video + source code]
如何快速进阶自动化测试?听听这3位BAT大厂测试工程师的切身感想....
Mysql database indexing tutorial (super detailed)
The main thread anr exception is caused by too many binder development threads
Case sharing | integrated construction of data operation and maintenance in the financial industry
【历史上的今天】7 月 5 日:Google 之母出生;同一天诞生的两位图灵奖先驱
China law network joins hands to observe the cloud, and the online system is a full link observable platform
潘多拉 IOT 开发板学习(HAL 库)—— 实验8 定时器中断实验(学习笔记)
Use file and directory properties and properties
企业数字化转型之路,从这里开始
7-1 linked list is also simple fina
Is it safe to make fund fixed investment on access letter?
案例分享|金融业数据运营运维一体化建设
爬虫01-爬虫基本原理讲解
The monthly list of Tencent cloud developer community videos was released in May 2022
紧固件行业供应商绩效考核繁琐?选对工具才能轻松逆袭!
A2L file parsing based on CAN bus (3)
XML basic knowledge concept
R language uses lubridate package to process date and time data