BestCoder Round #73 (div.2)(hdu 5630)
Rikka with Chess
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 177 Accepted Submission(s): 161
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.
Each testcase contains two numbers n,m(n≤109,m≤109).
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stack>
#include<queue>
#include<math.h>
#include<algorithm>
#define MAX 10010
#define INF 0x7ffff
#define MAXM 100100
#define LL long long
using namespace std;
int main()
{
int t,n,m,k;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&n,&m);
k=n/2+m/2;
printf("%d\n",k);
}
return 0;
}
BestCoder Round #73 (div.2)(hdu 5630)的更多相关文章
- BestCoder Round #71 (div.2) (hdu 5621)
KK's Point Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
- BestCoder Round #71 (div.2) (hdu 5620 菲波那切数列变形)
KK's Steel Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
- hdu5631 BestCoder Round #73 (div.2)
Rikka with Graph Accepts: 123 Submissions: 525 Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- hdu5634 BestCoder Round #73 (div.1)
Rikka with Phi Accepts: 5 Submissions: 66 Time Limit: 16000/8000 MS (Java/Others) Memory Limit: ...
- hdu5630 BestCoder Round #73 (div.2)
Rikka with Chess Accepts: 393 Submissions: 548 Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- Codeforces Round #316 (Div. 2) (ABC题)
A - Elections 题意: 每一场城市选举的结果,第一关键字是票数(降序),第二关键字是序号(升序),第一位获得胜利. 最后的选举结果,第一关键字是获胜城市数(降序),第二关键字是序号(升序) ...
- hdu 5424 Rikka with Graph II (BestCoder Round #53 (div.2))(哈密顿通路判断)
http://acm.hdu.edu.cn/showproblem.php?pid=5424 哈密顿通路:联通的图,访问每个顶点的路径且只访问一次 n个点n条边 n个顶点有n - 1条边,最后一条边的 ...
- BestCoder Round #69 (div.2)(hdu5611)
Baby Ming and phone number Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Ja ...
- BestCoder Round #73 (div.2)1002/hdoj5631
题意: 给出一张 nnn 个点 n+1n+1n+1 条边的无向图,你可以选择一些边(至少一条)删除. 分析: 一张n个点图,至少n-1条边才能保证联通 所以可以知道每次可以删去1条边或者两条边 一开始 ...
随机推荐
- Android开发之创建App Widget和更新Widget内容
App WidgetsApp Widgets are miniature application views that can be embedded in other applications (s ...
- SQL server函数大全
函数类别 作用 聚合函数 执行的操作是将多个值合并为一个值.例如 COUNT.SUM.MIN 和MAX. 配置函数 是一种标量函数,可返回有关配置设置的信息. 转换函数 将值从一种数据类型转换为另一种 ...
- 对List顺序,逆序,随机排列实例代码
ackage Test; import java.util.Collections; import java.util.LinkedList; import java.util.List; p ...
- VB获取浏览器版本
String userAgent; userAgent = Request.UserAgent; ) { // The browser is Microsoft Internet Explorer V ...
- Fatal NI connect error 12170
Fatal NI connect error 12170 转载:http://www.xifenfei.com/1812.html 今天在一台服务器的日志文件中,发现如下信息: Fatal NI co ...
- [转]ASP.NET数据库连接字符串总结
这个不难,而且很重要,但总忘,找了篇比较全的,作为资料. 原文链接http://developer.51cto.com/art/201107/275406.htm 关于数据库链接字符串的相关知识,我们 ...
- Java [Leetcode 125]Valid Palindrome
题目描述: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ...
- LeetCode: Single Number I && II
I title: Given an array of integers, every element appears twice except for one. Find that single on ...
- 调试WEB APP多设备浏览器(转)
方法:adobe shadow \ opera远程调试\ weinre adobe shadow: 我们经常使用Firefox的firebug或者Chrome的开发人员工具进行Web调试页面,J ...
- 如何寻找设计灵感?写给刚入行的设计师(转自UI中国)
如何寻找设计灵感?写给刚入行的设计师 如何寻找设计灵感? 这一次的文章,我想和大家聊聊年轻的设计师在没有那么多经验的情况下如何寻找设计师灵感.(希望这篇文章也能帮助感同身受的你) 每个设计师对设计都有 ...