当前位置:网站首页>CF: B. almost Ternary Matrix [symétrie + règles de recherche + Construction + I am Construction Waste]
CF: B. almost Ternary Matrix [symétrie + règles de recherche + Construction + I am Construction Waste]
2022-07-05 18:58:00 【Rétrospective du roi dragon blanc】
Analyse
Tendance à la symétrie,Parce que oui2Multiple de,Alors considérez l'unit é de base2 * 2
1 0 | 0 1
0 1 | 1 0
ABA…
BAB…
…
Nous définissons ci - dessus deux types particuliers de2 * 2DeAEtB
Et puis on peut construireABL'aspect entrelacé,Conforme au premier et au deuxième exemple
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)
Résumé
Je suis une ordure de construction.
Je cherche des petits trucs réguliers
边栏推荐
- 集合处理的利器
- Word查找红色文字 Word查找颜色字体 Word查找突出格式文本
- Use of websocket tool
- Reading notes of Clickhouse principle analysis and Application Practice (5)
- 自动化测试的好处
- cf:B. Almost Ternary Matrix【对称 + 找规律 + 构造 + 我是构造垃圾】
- Overview of video self supervised learning
- 《ClickHouse原理解析与应用实践》读书笔记(5)
- Technology sharing | interface testing value and system
- vs2017 qt的各种坑
猜你喜欢
鱼和熊掌可以兼得!天翼云弹性裸金属一招鲜!
2022最新大厂Android面试真题解析,Android开发必会技术
基于can总线的A2L文件解析(3)
A cloud opens a new future of smart transportation
一朵云开启智慧交通新未来
Postman核心功能解析 —— 参数化和测试报告
小程序 修改样式 ( placeholder、checkbox的样式)
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
cf:B. Almost Ternary Matrix【对称 + 找规律 + 构造 + 我是构造垃圾】
[detailed explanation of AUTOSAR 14 startup process]
随机推荐
如何快速进阶自动化测试?听听这3位BAT大厂测试工程师的切身感想....
ROS installation error sudo: rosdep: command not found
Thoroughly understand why network i/o is blocked?
RPC协议详解
企业级数据安全,天翼云是这样理解的
Redhat7.4 configure Yum software warehouse (rhel7.4)
中文版Postman?功能真心强大!
5年经验Android程序员面试27天,2022程序员进阶宝典
Oracle date format conversion to_ date,to_ char,to_ Timestamp mutual conversion
ICML2022 | 长尾识别中分布外检测的部分和非对称对比学习
Video fusion cloud platform easycvr adds multi-level grouping, which can flexibly manage access devices
AI Open2022|基于异质信息网络的推荐系统综述:概念,方法,应用与资源
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
AI金榜题名时,MLPerf榜单的份量究竟有多重?
2022 the most complete Tencent background automation testing and continuous deployment practice in the whole network [10000 words]
Use QT to traverse JSON documents and search sub objects
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
Benefits of automated testing
一朵云开启智慧交通新未来
Is it safe to make fund fixed investment on access letter?