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…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4121 题意:中国象棋对决,黑棋只有一个将,红棋有一个帅和不定个车 马 炮冰给定位置,这时当黑棋走,问你黑棋是不是被将死了(当前位置被将,能走得下一步也被将) 题解:代码里面注释很详细,我就不多说了,知道象棋规则的同学基本上都可以做出来 AC代码: #include <iostream> #include <cstdio> #include <cstring> #include…
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…
题意: 给一个象棋局势,问黑棋是否死棋了,黑棋只有一个将,红棋可能有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 &…
Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7194    Accepted Submission(s): 3345 Problem Description 话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了.显然,作为多年拼搏的商人,XHD不会坐以待毙的.  一天,当他正在苦思冥想解困良策的…
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; int jc[100003]; int p; int ipow(int x, int b) { ll t = 1, w = x;…