上一页 1 2 3 4 5 6 7 ··· 23 下一页
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=29368【题解】:模拟,然后对x,进行枚举,看是否所有都满足条件【code】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 using namespace std; 10 11 12 double stack[1000]; 13 int s_cnt; 14 15 double fabs(double a) 16 { 17 return... 阅读全文
posted @ 2013-10-04 14:28 crazy_apple 阅读(205) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=29373【题意】:模拟光标输入【题解】:用双向列表模拟实现,这里用其他模拟会超时,注意内存的释放【code】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 using namespace std;10 11 struct Nod12 {13 char ch;14 Nod * second;15 Nod * first;16 Nod()... 阅读全文
posted @ 2013-10-04 14:24 crazy_apple 阅读(255) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=29375【题意】:可以对两字符串进行如下操作: 1、可以无损耗交换相邻两个字符(可以理解成交换任意字符) 2、可以改变一个字符 x->y,花费为 x-y 的绝对值 求花费最少,将两字符串变成一样【题解】: 排序字符串,然后对应相减【code】: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 char str1[100010],str2[100010]; 9 10 int abs(int... 阅读全文
posted @ 2013-10-04 14:18 crazy_apple 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=1057【题意】:给定x的值,带入f(x)求函数值【题解】:注意第一个数的符号可能是'+',这里把我坑死了。。。【code】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 char str[100000],tstr[1000];10 int stack[10000];11 void init()12 {13 int i;14 for(i=0;i='... 阅读全文
posted @ 2013-09-30 20:09 crazy_apple 阅读(277) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 23 下一页