HDU 4121 Xiangqi 模拟题】的更多相关文章

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…
题意: 给一个象棋局势,问黑棋是否死棋了,黑棋只有一个将,红棋可能有2~7个棋,分别可能是车,马,炮以及帅. 解法: 开始写法是对每个棋子,都处理处他能吃的地方,赋为-1,然后判断将能不能走到非-1的点.但是WA了好久,也找不出反例,但就是觉得不行,因为可能有将吃子的情况,可能有hack点.但是比赛后还是被我调出来了. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cs…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4121 题意:中国象棋对决,黑棋只有一个将,红棋有一个帅和不定个车 马 炮冰给定位置,这时当黑棋走,问你黑棋是不是被将死了(当前位置被将,能走得下一步也被将) 题解:代码里面注释很详细,我就不多说了,知道象棋规则的同学基本上都可以做出来 AC代码: #include <iostream> #include <cstdio> #include <cstring> #include…
模拟吧,算是... 被这个题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…
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…
题目链接 写了俩小时+把....有一种情况写的时候漏了...代码还算清晰把,想了很久才开写的. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; ],flag[],o[],ans[]; ]; ]; ][]; ] = {,,,,,,,,,,,,}; void judge13() { int i; int s1,s0,s2,key; s1 = s2 = s0 = ;…
题目很简单不多说了,我只是觉得这题目的输入方式还是很有特点的 #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> using namespace std; struct People{ ]; int h1 , h2 , m1 , m2 , s1 , s2; }p[]; bool cmp1(const People &p1 , const Peopl…
HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011 亚洲北京赛区网络赛题目) Eliminate Witches! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 863    Accepted Submission(s): 342 Problem Description Kaname Mado…
题意: 有两只兔子,一只在左上角,一只在右上角,两只兔子有自己的移动速度(每小时),和初始移动方向. 现在有3种可能让他们转向:撞墙:移动过程中撞墙,掉头走未完成的路. 相碰: 两只兔子在K点整(即处理完一小时走的路后),在同一点,兔子A和兔子B的方向互相交换一下. 向左转 : 两只兔子有自己的转向时间T,每隔T小时,它就会向左转, 但是相碰的优先级高于它,相碰之后就不处理左转问题了. 写模拟题还是很有趣的......练练手 #include <iostream> #include <a…
Problem Description In a military parade, the King sees lots of new things, including an Andriod Phone. He becomes interested in the pattern lock screen. The pattern × square lattice, the three points ,,, the three points ,,, and the three points ,,.…