上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 38 下一页
摘要: 一直在纠结怎么样表示找到了人,,,开始时竟灰笨得设两个BOOL。后来参考别人的可以使用二进制位。另外,此处有一个剪枝就是,就到达该点之后的状态的found(即找到人的状态)在之前已出现过,可以剪去。#include #include #include #include using namespace... 阅读全文
posted @ 2015-03-22 22:07 chenjunjie1994 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 搞了好久,发现自己是想法没错的,错在输入,必须是while(){}#include #include #include #include using namespace std;struct Water{ int px,py; int dirx,diry; Water(){} ... 阅读全文
posted @ 2015-03-22 20:09 chenjunjie1994 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 就是那个O(nlogn)的LIS算法。#include #include using namespace std;int dt[100005],dp[100005],num[100005];int n,d;int bin(int a){ int l=1,r=n; int ans=0; while(l... 阅读全文
posted @ 2015-03-22 16:32 chenjunjie1994 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 好端端的被HACK掉了。。。应该是在两端都要补W个0才对,之前只想到要在后面补足0,没想到前面也应该补足,因为前面即便存在0也可能使得移动的积木数最少。。T_T#include #include #include #include #define LL __int64using namespace ... 阅读全文
posted @ 2015-03-21 22:03 chenjunjie1994 阅读(144) 评论(0) 推荐(0) 编辑
摘要: EASY题,直接统计(1,1)到(i,j)的黑点个数,然后计算出以(i,j)点为右下角的矩形内的黑点个数是x*y即可。注意当x==y时不要重复统计。#include #include #include #include #include using namespace std;const int N... 阅读全文
posted @ 2015-03-20 17:33 chenjunjie1994 阅读(119) 评论(0) 推荐(0) 编辑
摘要: SHIT,SHIT,SHIT,SHIT,SHIT...这道题可以使用AC自动机+DP来解决。也就是用非法路径建立TRIE图,然后从trie[root][1]点开始广搜DP即可。千万要注意一点,题目里有说:小明每次走的时候只能走到比当前所在点编号大的位置因为这个WA了无限次。。。#include #i... 阅读全文
posted @ 2015-03-20 17:13 chenjunjie1994 阅读(258) 评论(0) 推荐(0) 编辑
摘要: EASY题,快速幂。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define LL __int64 7 using namespace std; 8 const LL MOD=1000000007; 9 10 ... 阅读全文
posted @ 2015-03-20 12:56 chenjunjie1994 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 中了一个坑,循环时竟然从该物品的价格和分数开始,中招了,因为就算价格高于钱数,可能分数符合呢????所以要从零开始。#include #include #include #include #include using namespace std;int dp[102][102][102][7];in... 阅读全文
posted @ 2015-03-17 23:14 chenjunjie1994 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 同样是二分+DLX即可。#include #include #include #include #include #define LL __int64using namespace std;const int maxn=3800;const int maxc=65;const int maxr=65... 阅读全文
posted @ 2015-03-17 22:03 chenjunjie1994 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 二分答案+重复覆盖。注意返回的条件哦,不能光套模板。#include #include #include #include #include using namespace std;const int maxn=3600;const int maxc=55;const int maxr=55;con... 阅读全文
posted @ 2015-03-17 20:55 chenjunjie1994 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 刷水完毕,年月日,日日日日日日日日日日日日日日日日日日#include int a[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};const int Y = 2013,M = 3,D = 24;int leap(int y){ if(y%400 == ... 阅读全文
posted @ 2015-03-16 22:00 chenjunjie1994 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 省一等,保研。#include #include #include #include using namespace std;int H,M,S,h,m,s;int main(){ int T; bool flag1,flag2; scanf("%d",&T); while(... 阅读全文
posted @ 2015-03-16 21:56 chenjunjie1994 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 哈哈哈哈哈哈哈哈哈,省赛,一等奖,一定的一定的一定的一定的。。。#include #include #include #include using namespace std;const int N=110;bool flag[N];int main(){ int T,n,cnt,maxh,t... 阅读全文
posted @ 2015-03-16 21:33 chenjunjie1994 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 看不起我?哼,迟早让你后悔,让你妒忌。操操操操。。。。。T_T#include #include #include #include #include #define LL __int64using namespace std;const int N=25;struct Judger{ dou... 阅读全文
posted @ 2015-03-16 21:15 chenjunjie1994 阅读(5198) 评论(0) 推荐(0) 编辑
摘要: 今天让人看不起了,话说好伤心,说我搞了ACM那么久都没获得拿得出手的奖。。。。今晚爷爷我要狂刷2013腾讯马拉松的水题,奶奶滴,哈哈哈哈。。。T_T 1 #include 2 #include 3 #include 4 #include 5 #define LL __int64 6 7 u... 阅读全文
posted @ 2015-03-16 21:05 chenjunjie1994 阅读(102) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 38 下一页