上一页 1 2 3 4 5 6 ··· 23 下一页
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=25659 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 10 int main()11 {12 int n,cas=1;13 while(~scanf("%d",&n))14 {15 int i;16 stack stk;17 stk.push(-1);18 ... 阅读全文
posted @ 2013-11-04 16:38 crazy_apple 阅读(202) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=25662 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define N 150 10 using namespace std; 11 12 struct Nod 13 { 14 int x,y,step; 15 }node[15000]; 16 17 int map[N][N]; 18 int mark[N][N]; 19 int p... 阅读全文
posted @ 2013-11-04 16:36 crazy_apple 阅读(300) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;char str[20000];int work(int m){ int i,j,l; i=0; j=1; while(im) break; if(str[(i+l)%m] > str[(j+l)%m]) i=i+l+1; else j=j+l+1; if(i==j) j=i+1; } if(i<j) return i; return j;}int main(){ int text... 阅读全文
posted @ 2013-10-30 17:13 crazy_apple 阅读(631) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=4207【题意】:中文题,略【题解】:模拟【code】: 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 struct Nod 8 { 9 int t,sh; 10 }node[3][10]; 11 12 void init() 13 { 14 //XsugarX 15 node[0][0].t = 15; 16 node[0][0].sh = 650; 17 ... 阅读全文
posted @ 2013-10-10 19:30 crazy_apple 阅读(295) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=4208【题意】:如题,求冒泡排序遍历趟数【题解】:这题开始2B了,先模拟TLE,然后想了一下,能不能根据始末状态来得到点什么。。。 3 24 1 |==>如果开始的位置在 i 最后位置在 j ,如果 i>j那么最少遍历次数为 i-j 1 2 3 4【code】: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 struct Nod 9 {10 int a;11... 阅读全文
posted @ 2013-10-10 19:28 crazy_apple 阅读(276) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=4209题意:如题题解:公式直接计算,或者角平分线求交点【code1】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 //定义点 9 struct point10 {11 double x,y;12 };13 14 typedef struct point point;15 16 17 double fabs(double x)18 {19 return ... 阅读全文
posted @ 2013-10-10 19:12 crazy_apple 阅读(202) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=33656【题解】:暴力搜索题【code】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 char map[100][100]; 10 int vis[100][100]; 11 int n,m; 12 int B,F; 13 int cx[]={0,-1,1,-1,1,-1,0,1}; 14 int cy[]={1,0,1,-1,-1,1,-1... 阅读全文
posted @ 2013-10-05 15:06 crazy_apple 阅读(225) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=33648【题解】:结果先对MOD*2取模,才能得到结果是否是正确的奇偶问题,得到最后结果之后再对MOD取模。。。【code】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 #define MOD 1000000007 9 10 struct Nod11 {12 int parent;13 long long sum;14 int edge;15... 阅读全文
posted @ 2013-10-05 14:57 crazy_apple 阅读(201) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=33647【题意】:字符串匹配,暴力配就行了【题解】:截出单词,然后进行匹配就行了【code】: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 char tstr[100][100]; 9 10 int main()11 {12 int t;13 scanf("%d",&t);14 getchar();15 while(t--)16 {17 ... 阅读全文
posted @ 2013-10-05 14:50 crazy_apple 阅读(266) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=16493【题解】:矩阵快速幂【code】: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int N; 8 struct matrix 9 { 10 double a[100][100]; 11 }origin,res; 12 13 14 matrix multiply(matrix x,matrix y) 15 { 16 matrix tem... 阅读全文
posted @ 2013-10-04 14:31 crazy_apple 阅读(375) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 23 下一页