摘要: Problem A: Small change题解:http://www.cnblogs.com/crazyapple/p/3349469.htmlProblem B: Scoop water题解:http://www.cnblogs.com/crazyapple/p/3349478.htmlProblem D: CX and girls题解:http://www.cnblogs.com/crazyapple/p/3349480.htmlProblem F: ZZY and his little friends题解:http://www.cnblogs.com/crazyapple/p/334 阅读全文
posted @ 2013-10-02 17:29 crazy_apple 阅读(154) 评论(0) 推荐(0) 编辑
摘要: http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=9【题解】: 这题卡了一下,卡在负数的情况,负数输出 0 这题主要找到一个个相邻重复的位置,然后加1上去,看是否进位,直到满足条件为止【code】: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 8 void inttostr(int n,char *str) 9 { 10 int cnt=0; 11 while(n) 12 { 13... 阅读全文
posted @ 2013-10-02 17:20 crazy_apple 阅读(247) 评论(0) 推荐(0) 编辑
摘要: http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=5【题解】:没想通这题暴力可以过。。。。【code】: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int arr[100010]; 7 8 int main() 9 {10 int n,m;11 while(~scanf("%d%d",&n,&m))12 {13 int i,j;14 for(i=0;im)20 ... 阅读全文
posted @ 2013-10-02 17:14 crazy_apple 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 【题解】:最短路径问题,保证距离最短的同时,学妹权值最大,哈哈【code】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #define N 50005 8 #define INF 100000000 9 using namespace std; 10 11 struct Edge 12 { 13 int to; 14 int next; 15 int w; 16 int num; 17 }edge[Nb.dis; 30 return a.num p_q; 5... 阅读全文
posted @ 2013-10-02 17:13 crazy_apple 阅读(236) 评论(0) 推荐(0) 编辑
摘要: http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=1【题解】:卡特兰数取模h(n) = h(n-1)*(4*n-2)/(n+1)这题我们公式选择错了,不过还是能AC的因为要取模,应该选 h(n)=h(0)*h(n-1)+h(1)*h(n-2)+...+h(n-1)*h(0) (n>=2)【code-java】: 1 import java.math.BigInteger; 2 import java.util.Scanner; 3 4 public class Main { 5 6 public stati... 阅读全文
posted @ 2013-10-02 17:10 crazy_apple 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 【题解】:二进制拆分 任意一个整数都可以拆分成 2^0 + 2^1 + 2^2 + 2^3 + ....+ m【code】: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 int main() 9 {10 int n;11 while(~scanf("%d",&n))12 {13 int i,sum=0;14 for(i=0;;i++)15 {16 sum+=pow(2,i);17 ... 阅读全文
posted @ 2013-10-02 17:02 crazy_apple 阅读(277) 评论(0) 推荐(0) 编辑