摘要: 很简单了,当m>=3&&m-1&&m.compareTo(n.add(p))<1){ System.out.println("YES"); } else System.out.println("NO"); } }} 阅读全文
posted @ 2015-03-29 21:57 chenjunjie1994 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 简单得不能再简单的DP了。#includeconst int inf=1<<30;using namespace std;int map[22][22];int dp[22][22];//表示前i个时刻在第j个位置时的最小消耗能量int n,m;int main(){ while(~scanf... 阅读全文
posted @ 2015-03-29 21:48 chenjunjie1994 阅读(132) 评论(0) 推荐(0) 编辑
摘要: DP.设状态dp[i][j]表示j辆车后还剩余i个人的花费,枚举一个车的座位k,加上剩下人数i,注意i+k不能超过n,就很容易dp了。#include #include #include using namespace std;const int inf=(1n) break; dp[i]... 阅读全文
posted @ 2015-03-29 20:38 chenjunjie1994 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 也是水题了,不过注意负负也可以为正就好了。今天看见bestcoder上的人那么厉害,唉,我什么时候才能赶上啊。。#include #include #include #include #include #define LL __int64using namespace std;int main(){... 阅读全文
posted @ 2015-03-29 19:47 chenjunjie1994 阅读(112) 评论(0) 推荐(0) 编辑