博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU 5630 Rikka with Chess(翻棋子)
阅读量:4137 次
发布时间:2019-05-25

本文共 1023 字,大约阅读时间需要 3 分钟。

Rikka with Chess

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 639 Accepted Submission(s): 541
Problem Description
Yuta gives Rikka a chess board of size
n×m .
As we all know, on a chess board, every cell is either black or white and every two cells that share a side have different colors.
Rikka can choose any rectangle formed by board squares and perform an inversion, every white cell becomes black, and vice versa.
Rikka wants to turn all cells into the same color, please tell Rikka the minimal number of inversions she need to achieve her goal.
Input
The first line contains a number
T(T10) ——The number of the testcases.
Each testcase contains two numbers
n,m(n109,m109) .
Output
For each testcase, print a single number which represents the answer.
Sample Input
31 22 23 3
Sample Output
122
Source
/*思路:刚看到题目被吓到,然后画图猜,发现这个规律,所以不要被题目吓到.. */#include
using namespace std;int main(){ int n,m,t; cin>>t; while(t--){ cin>>n>>m; cout<

转载地址:http://udmvi.baihongyu.com/

你可能感兴趣的文章
`MQTTClient (~> 0.2.6)` required by `Podfile`
查看>>
X-Code 报错 ld: library not found for -lAFNetworking
查看>>
Bitcode
查看>>
If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
查看>>
3.5 YOLO9000: Better,Faster,Stronger(YOLO9000:更好,更快,更强)
查看>>
iOS菜鸟学习--如何避免两个按钮同时响应
查看>>
How to access the keys in dictionary in object-c
查看>>
iOS菜鸟学习—— NSSortDescriptor的使用
查看>>
hdu 3787 hdoj 3787
查看>>
hdu 3790 hdoj 3790
查看>>
hdu 3789 hdoj 3789
查看>>
hdu 3788 hdoj 3788
查看>>
zju 1003 zoj 1003
查看>>
zju 1004 zoj 1004
查看>>
zju 1005 zoj 1005
查看>>
zju 1006 zoj 1006
查看>>
【虚拟机】虚拟化架构与系统部署(Windows系统安装)
查看>>
字节跳动安卓开发实习生面试分享
查看>>
好书分享之——《能力陷进》
查看>>
阅读笔记《c++ primer》
查看>>