上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页
摘要: 题意:给出四张扑克牌 问能否算出24思路:http://blog.csdn.net/xingyeyongheng/article/details/11137631 其实这题只有两种运算顺序 1(a@b)@c@d 2 (a@b)@(c@d) 所以只需要把数字和运算符全排列遍历一... 阅读全文
posted @ 2015-05-11 20:37 sola94 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题意:有n个村子 由m条路联通 其中q条路会依次被摧毁 问每次摧毁后会有多少片村庄被孤立思路:首先算出q条路都被摧毁后被孤立的村庄数 然后再逆序把每条路修复上 每修复一条孤立的村庄就减少一片 最后再输出每次记录的结果#include#include#include#includeu... 阅读全文
posted @ 2015-05-07 21:35 sola94 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#include#include#include#includeusing namespace std;int dir4[][2]={{0,1},{1,0},{0,-1},{-1,0}};int dir8[][2]={{... 阅读全文
posted @ 2015-05-05 21:31 sola94 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 题意:有一个排n个建筑 每个高不定 现在要消去全部建筑 方法有两种 1 消去高度为某值的全部方块 2 消去一整个建筑 问 如何通过最少步骤消去思路:首先将数组从大到小排序 if(i+a[i]#include#includeusing namespace ... 阅读全文
posted @ 2015-05-05 21:30 sola94 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 题意:有两个人 每个人可以撒两个骰子 给出每个骰子的最大和最小值 谁撒出的数值和大谁获胜思路: 把两个人可能的值区间算出 因为是均匀分布 所以两人重叠的区间胜率相同 那么 只需计算谁获胜的区间大即可得出结果#include#include#include#include#include#... 阅读全文
posted @ 2015-05-05 21:21 sola94 阅读(265) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/diy/contest_showproblem.php?cid=18447&pid=1001已经过了时间不知道能不能ac 不过思路应该是没错的题意:给定A,B,C,计算(A^(B^C))%100000007 (已知100000007是素数)思路:费马小定理... 阅读全文
posted @ 2015-05-05 21:13 sola94 阅读(252) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#include#include#include#include#define LL long longusing namespace std;const int MAXN=10;const int INF=0x3f3f... 阅读全文
posted @ 2015-04-21 20:25 sola94 阅读(156) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#include#include#include#include#define LL long longusing namespace std;const int MAXN=10;const int INF=0x3f3f... 阅读全文
posted @ 2015-04-21 20:24 sola94 阅读(187) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#include#include#include#include#define LL long longusing namespace std;int map[10][10];int vis[10][10];int a[... 阅读全文
posted @ 2015-04-21 20:22 sola94 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;char a[1000+100];int vis[1000+100];int n;int cnt;int ok;bool huiwen(){ int l=0; int r=strlen... 阅读全文
posted @ 2015-04-21 20:17 sola94 阅读(80) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页