1178C C. Tiles

博客探讨了一种方形瓷砖的装饰问题,其中瓷砖被对角线分为黑白两部分。题目要求在w×h的厨房地面上排列这些瓷砖,使得相邻瓷砖的边缘颜色不相同。内容提供了一个例子和输入输出格式,并指出解决方案涉及计算可能的排列数量,通过快速幂计算2的(n+m)次方模998244353的结果。
摘要由CSDN通过智能技术生成

C. Tiles
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Bob is decorating his kitchen, more precisely, the floor. He has found a prime candidate for the tiles he will use. They come in a simple form factor — a square tile that is diagonally split into white and black part as depicted in the figure below.

The dimension of this tile is perfect for this kitchen, as he will need exactly w×h tiles without any scraps. That is, the width of the kitchen is w tiles, and the height is h tiles. As each tile can be rotated in one of four ways, he still needs to decide on how exactly he will tile the floor. There is a single aesthetic criterion that he wants to fulfil: two adjacent tiles must not share a colour on the edge — i.e. one of the tiles must have a white colour on the shared border, and the second one must be black.

The picture on the left shows one valid tiling of a 3×2 kitchen. The

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值