hdoj--5630--Rikka with Chess(规律题)
Rikka with Chess
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 499 Accepted Submission(s): 416
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.
T(T≤10)
——The number of the testcases.
Each testcase contains two numbers n,m(n≤10
3
1 2
2 2
3 3
1
2
2
#include<cstdio>
#include<queue>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int a,b;
cin>>a>>b;
cout<<a/2+b/2<<endl;
}
return 0;
}
hdoj--5630--Rikka with Chess(规律题)的更多相关文章
- hdu 5630 Rikka with Chess
来自官方题解: AC代码: #pragma comment(linker, "/STACK:1024000000,1024000000") #include<iostream ...
- Rikka with Chess(规律)
Rikka with Chess Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
- LightOJ1010---Knights in Chessboard (规律题)
Given an m x n chessboard where you want to place chess knights. You have to find the number of maxi ...
- Codeforces - 规律题 [占坑]
发现自己容易被卡水题,需要强行苟一下规律题 CF上并没有对应的tag,所以本题集大部分对应百毒搜索按顺序刷 本题集侧重于找规律的过程(不然做这些垃圾题有什么用) Codeforces - 1008C ...
- ACM_送气球(规律题)
送气球 Time Limit: 2000/1000ms (Java/Others) Problem Description: 为了奖励近段时间辛苦刷题的ACMer,会长决定给正在机房刷题的他们送气球. ...
- hdoj--1005--Number Sequence(规律题)
Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- hdoj 2803 The MAX【简单规律题】
The MAX Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Sub ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- HDOJ 1326. Box of Bricks 纯水题
Box of Bricks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) To ...
随机推荐
- Ajax——php基础知识(三)
上传文件 1.get是传不了文件的,只能用post 2.enctype需要重新设置,默认是application/x-www-form-urlencoded,会在发送到服务器之前,所有字符都会进行编码 ...
- jQuery——val()、text()、html()
val():获取标签中的value属性的值.带有参数是赋值(类比js中的value属性) text():获取双闭合标签中的文本值.(不识别标签)(类比innerText) html():获取双闭合标签 ...
- (转) 分布式文件存储FastDFS(七)FastDFS配置文件详解
http://blog.csdn.net/xingjiarong/article/details/50752586 配置FastDFS时,修改配置文件是很重要的一个步骤,理解配置文件中每一项的意义更加 ...
- C# Request
string type = Request["type"]; //值为null; //?type= 值为""; //?type=12 值为"12&qu ...
- LINUX-查看进程内环境变量
ps -ef find PID cat /proc/$PID/environ | grep ENV
- hbase + phoenix 单机版安装
1. 环境: centos 6.5 jdk 1.8.0 http://www.oracle.com/te ...
- jQuery匹配id 批量修改css属性
<ul id="foreignCurrencyTree_1_ul"> <li id="foreignCurrencyTree_11_li"&g ...
- (ccf)201709-4 通信网络
#include<iostream> #include<memory.h> #include<stack> #include<string> #incl ...
- Flask - 内置Session
目录 Flask - 内置Session 基本用法 给视图添加装饰器验证 Flask - 内置Session Flask中的Session非常的奇怪,他会将你的SessionID存放在客户端的Cook ...
- hdu 5179 beautiful number
beautiful number 问题描述 令 A = \sum_{i=1}^{n}a_i * {10}^{n-i}(1\leq a_i \leq 9)A=∑i=1nai∗10n−i ...