HDU 4121 Xiangqi 我老了?】的更多相关文章

Xiangqi Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3193    Accepted Submission(s): 780 Problem Description Xiangqi is one of the most popular two-player board games in China. The game repre…
Xiangqi Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4121 Description Xiangqi is one of the most popular two-player board games in China. The game represents a battle between two armies with the goal of captu…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4121 题意:中国象棋对决,黑棋只有一个将,红棋有一个帅和不定个车 马 炮冰给定位置,这时当黑棋走,问你黑棋是不是被将死了(当前位置被将,能走得下一步也被将) 题解:代码里面注释很详细,我就不多说了,知道象棋规则的同学基本上都可以做出来 AC代码: #include <iostream> #include <cstdio> #include <cstring> #include…
题意: 给一个象棋局势,问黑棋是否死棋了,黑棋只有一个将,红棋可能有2~7个棋,分别可能是车,马,炮以及帅. 解法: 开始写法是对每个棋子,都处理处他能吃的地方,赋为-1,然后判断将能不能走到非-1的点.但是WA了好久,也找不出反例,但就是觉得不行,因为可能有将吃子的情况,可能有hack点.但是比赛后还是被我调出来了. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cs…
模拟吧,算是... 被这个题wa到哭,真是什么都不想说了...上代码 #include <iostream> #include <cstring> using namespace std; struct node { int x,y; char c; }q[]; int main (){ int n,x,y; ; ][]; while (cin>>n>>x>>y){ ) break ; memset (map,,sizeof map); ;i&l…
http://www.bnuoj.com/v3/problem_show.php?pid=10277 //#pragma comment(linker, "/STACK:16777216") //for c++ Compiler #include <stdio.h> #include <iostream> #include <climits> #include <cstring> #include <cmath> #inclu…
http://acm.hdu.edu.cn/showproblem.php?pid=4461 题意:每个棋子有一个权值,给出红方的棋子情况,黑方的棋子情况,问谁能赢. 思路:注意“ if a player has no Ma or no Pao, or has neither, his total offense power will be decreased by one”这句话即可. #include <cstdio> #include <cstring> #include &…
题意:给定一些字母,每个字母都代表一值,如果字母中没有B,或者C,那么就在总值大于1的条件下删除1,然后比较大小. 析:没什么好说的,加起来比较就好了. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include &…
Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7797    Accepted Submission(s): 3526 Problem Description 话说上回讲到海东集团推选老总的事情,最终的结果是XHD以微弱优势当选,从此以后,"徐队"的称呼逐渐被"徐总"所取代,海东集…
深度搜索 剪枝 还不是很理解 贴上众神代码 //http://blog.csdn.net/vsooda/article/details/7884772#include<iostream> #include<math.h> using namespace std; char map[10][10]; int N,M,T; int di,dj,escape; int dir[4][2]={{0,-1},{0,1},{1,0},{-1,0}}; void dfs(int x,int y,…