本文版权归点A点C和博客园共有,欢迎转载,但必须保留此段声明,并给出原文连接,谢谢合作!!!

2013年8月7日

zoj 1372 Networking poj1287

摘要: 1 #include 2 #include 3 #include 4 #include 5 #define MAXN 55 6 #define MAXM 10000 7 8 using namespace std; 9 struct edge10 {11 int u,v,w;12 }edges[MAXM];13 int parent[MAXN];14 int sumweight;15 int N,M;16 int i,j;17 void UFset()18 {19 for(i=1;i=0; s=parent[s]);28 while(s!=x)29 {30... 阅读全文

posted @ 2013-08-07 15:58 点A点C 阅读(202) 评论(0) 推荐(0) 编辑

zoj1718 Building a Space Station poj2031

摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define MAXN 101 7 #define MAXM 10000 8 using namespace std; 9 struct edge 10 { 11 int u,v; 12 double w; 13 }edges[MAXM]; 14 int parent[MAXN]; 15 int N,M; 16 double X[MAXN],Y[MAXN],Z[MAXN],R[MAXN]; 17 int i,j; 18 double sumw... 阅读全文

posted @ 2013-08-07 15:58 点A点C 阅读(158) 评论(0) 推荐(0) 编辑

zoj 1406 Jungle Roads poj 1251

摘要: 1 #include 2 #include 3 #include 4 #include 5 #define MAXN 30 6 #define MAXM 1000 7 using namespace std; 8 9 struct edge 10 { 11 int u,v,w; 12 }edges[MAXM]; 13 int parent[MAXN]; 14 int N,m; 15 int i,j; 16 int sumweight; 17 void UFset() 18 { 19 for(i=1;i=0;s=parent[s]); 28 whi... 阅读全文

posted @ 2013-08-07 15:58 点A点C 阅读(138) 评论(0) 推荐(0) 编辑

2013年5月4日

杭电OJ题目分类

摘要: 杭电OJ题目分类杭电ACM试题分类注:网上搜的第一篇1001 这个就不用说了吧1002 简单的大数1003 DP经典问题,最大连续子段和1004 简单题1005 找规律(循环点)1006 感觉有点BT的题,我到现在还没过1007 经典问题,最近点对问题,用分治1008 简单题1009 贪心1010 搜索题,剪枝很关键10111012 简单题1013 简单题(有个小陷阱)1014 简单题1015 可以看作搜索题吧1016 经典的搜索1017 简单数学题1018 简单数学题1019 简单数学题1020 简单的字符串处理1021 找规律的数学题1022 数据结构的题(栈的应用)1023 特殊的数(C 阅读全文

posted @ 2013-05-04 20:51 点A点C 阅读(2977) 评论(0) 推荐(0) 编辑

c语言中字符串处理函数

摘要: 1、 比较字符串大小函数 1) 忽略大小写---strcasecmp函数原型: int strcasecmp (const char *s1, const char *s2);函数说明: 用来比较参数s1和s2字符串,比较时会自动忽略大小写的差异2)忽略大小写—stricmp函数原型:int stricmp(char *str1, char *str2);函数说明:以大小写不敏感方式比较两个串3) 不忽略大小写—strcmp函数原型:int strcmp(char*str1,char*str2);函数说明:通过比较字串中各个字符的ASCII码,来比较参数Str1和Str2字符串,比较时考虑字符 阅读全文

posted @ 2013-05-04 16:49 点A点C 阅读(243) 评论(0) 推荐(0) 编辑

2013年4月20日

使用STL的next_permutation函数生成全排列(C++)

摘要: 文章作者:姜南(Slyar)文章来源:Slyar Home (www.slyar.com) 转载请注明,谢谢合作。下午研究了一下全排列算法,然后发现C++的STL有一个函数可以方便地生成全排列,这就是next_permutation在C++ Reference中查看了一下next_permutation的函数声明:#include <algorithm>bool next_permutation( iterator start, iterator end );Thenext_permutation() function attempts to transform the given 阅读全文

posted @ 2013-04-20 18:39 点A点C 阅读(322) 评论(0) 推荐(0) 编辑

Codeforces Beta Round #77 (Div. 2 Only)-A. Football

摘要: time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a str 阅读全文

posted @ 2013-04-20 17:24 点A点C 阅读(452) 评论(0) 推荐(0) 编辑

c语言字符串 数字转换函数大全

摘要: c语言字符串 数字转换函数大全补充:itoa (将数字转换为字符串)最近学数据结构老是做实验常用到字符串和数字的转换想找却发现网上的资料太散所以搜集整理一下 方便以后再用atof(将字符串转换成浮点型数)atoi(将字符串转换成整型数)atol(将字符串转换成长整型数)strtod(将字符串转换成浮点数)strtol(将字符串转换成长整型数)strtoul(将字符串转换成无符号长整型数)toascii(将整型数转换成合法的ASCII 码字符)toupper(将小写字母转换成大写字母)tolower(将大写字母转换成小写字母) atof(将字符串转换成浮点型数)相关函数 atoi,atol,st 阅读全文

posted @ 2013-04-20 16:51 点A点C 阅读(395) 评论(0) 推荐(0) 编辑

2013年4月13日

Codeforces Round #176 (Div. 2)总结-A. IQ Test

摘要: A. IQ Testtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the city of Ultima Thule job applicants are often offered an IQ test.The test is as follows: the person gets a piece of squared paper with a4 × 4square painted on it. Some of the s 阅读全文

posted @ 2013-04-13 19:00 点A点C 阅读(757) 评论(0) 推荐(0) 编辑

2013年3月6日

算法导论第三版目录

摘要: 目录出版者的话译者序前言第一部分 基础知识第1章 算法在计算中的作用1.1 算法1.2 作为一种技术的算法思考题本章注记第2章 算法基础2.1 插入排序2.2 分析算法2.3 设计算法2.3.1 分治法2.3.2 分析分治算法思考题本章注记第3章 函数的增长3.1 渐近记号3.2 标准记号与常用函数思考题本章注记第4章 分治策略4.1 最大子数组问题4.2 矩阵乘法的Strassen算法4.3 用代入法求解递归式4.4 用递归树方法求解递归式4.5 用主方法求解递归式4.6 证明主定理4.6.1 对b的幂证明主定理4.6.2 向下取整和向上取整思考题本章注记第5章 概率分析和随机算法5.1 雇 阅读全文

posted @ 2013-03-06 13:15 点A点C 阅读(11621) 评论(0) 推荐(1) 编辑

导航