码迷,mamicode.com
首页 > 其他好文
串(string)类的简单实现
串(String)又称字符串,是一种特殊的线性表,表中的元素是单个字符,串是由n个字符组成的有限序列。 S="c1c2c3c4...cn"............(n>=0) 本文实现了串的初始化,串长度的计算,求子串,插入、删除、加法、找位置以及串的输出等函数。 String.h #ifndef STRING_H_ #define STRING_H_ #include class St...
分类:其他好文   时间:2015-06-02 09:30:10    阅读次数:172
hdu1685 GCD 容斥原理
//数x小于等于b大于0的任意一个数,数y为小于等于d大于0的任意一个 //问有多少对x,y使得gcd(x,y) = k ; //且(x,y),(y,x)算一对 //可以转化为[1, b/k]中的x , 和 [1,d/k]中的y, //使得gcd(x,y) = 1  //可以枚举x , 在[1,d/k] 的范围内找大于x,且与x互质的数有多少个 //记录所有x的素数因子 //容斥原理...
分类:其他好文   时间:2015-06-02 09:30:49    阅读次数:135
【Scrapy】Spiders爬虫
Spider类定义了如何爬取某个网站。包括爬取的动作以及如何从网页的内容中提取结构化数据。 Spider就是定义爬取的动作及分析某个网页的地方。爬取的循环:①以初始的URL初始化Request,并设置回调函数。当该request下载完毕并返回时,将生成response,并作为参数传给该回调函数。 spider中初始的request是通过调用start_requests()来获取的。start_r...
分类:其他好文   时间:2015-06-02 09:29:28    阅读次数:440
【数据可视化】数据可视化分类
数据可视化分为:科学可视化、信息可视化,可视化分析学这三个主要分支。     科学可视化,处理科学数据,面向科学和工程领域的科学可视化,研究带有空间坐标和几何信息的三维空间测量数据、计算模拟数据和医疗影像数据等,重点探索如何有效地呈现数据中几何、拓扑和形状特征。信息可视化,处理对象是非结构化、非几何的抽象数据,如金融交易、社交网络和文本数据,其核心挑战是如何针对大尺度高维数据减少视觉混淆对有用信...
分类:其他好文   时间:2015-06-02 09:28:30    阅读次数:951
HDU 1004 Let the Balloon Rise (map使用)
map...
分类:其他好文   时间:2015-06-02 09:26:38    阅读次数:127
Project Euler:Problem 23 Non-abundant sums
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means...
分类:其他好文   时间:2015-06-02 09:26:34    阅读次数:154
Project Euler:Problem 24 Lexicographic permutations
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we...
分类:其他好文   时间:2015-06-02 09:28:13    阅读次数:121
WAMP环境下配置虚拟主机
基于域名添加虚拟主机 (本例子的域名为 www.shop.com) 第一步: 进入apache\conf目录里,打开httpd.conf文件。 第二步: 找到配置项 # Virtual hosts #Include conf/extra/httpd-vhosts.conf 第三步: 开启该虚拟主机的配置项并写上注释 # 启用虚拟主机文件 # Virtual hosts Inc...
分类:其他好文   时间:2015-06-02 09:28:31    阅读次数:116
Balloon Comes
Balloon Comes! 气球来了! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 22727    Accepted Submission(s): 8577 Problem Description The con...
分类:其他好文   时间:2015-06-02 09:26:02    阅读次数:125
LeetCode 137:Single Number II
Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using...
分类:其他好文   时间:2015-06-02 09:27:36    阅读次数:118
LeetCode 8:String to Integer (atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input case...
分类:其他好文   时间:2015-06-02 09:25:09    阅读次数:115
LeetCode 03: Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For ...
分类:其他好文   时间:2015-06-02 09:24:48    阅读次数:113
LeetCode 4: Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)) 代码如下: class Solutio...
分类:其他好文   时间:2015-06-02 09:26:44    阅读次数:103
LeetCode 8: Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. 本题是判断一个数是否是回文数。 代码如下: bool isPalindrome(int x) { int max = x; int min = 0; while(max >0){ ...
分类:其他好文   时间:2015-06-02 09:26:12    阅读次数:102
HDU ACM 2232 机器人的舞蹈
#include using namespace std; int base[4][4]={ //初始状态 {1,1,0,1}, {1,1,1,0}, {0,1,1,1}, {1,0,1,1}}; int a[2][4][4]; //滚动数组 void f(int n) { int i,j; if(n==0) { for(i=0;i...
分类:其他好文   时间:2015-06-02 09:25:12    阅读次数:205
uva 10494 高精度除法
这道题我wa了4次!!!RE了一次,直到看到了RE我才看到了希望,果然,把数组开大一点就过了,小白 在uva上的题好像叙述都不太精确,从来都不说数据最长多少,以至于只能瞎开数组,白白RE了一次,wa的原因是因 为数据类型错了,应该开long long的,我竟然忘了商也可以是大数的,,,唉,还是不够细心,不够认真啊。 贴代码: #include #include #include #defi...
分类:其他好文   时间:2015-06-02 09:25:02    阅读次数:125
第十二周项目一 教师兼干部类】 共建虚基类person
项目1 - 教师兼干部类】 分别定义Teacher(教师)类和Cadre(干部)类,采用多重继承方式由这两个类派生出新类Teacher_Cadre(教师兼干部)。要求:  (1)在两个基类中都包含姓名、年龄、性别、地址、电话等数据成员。  (2)在Teacher类中还包含数据成员title(职称),在Cadre类中还包含数据成员post(职务),在Teacher_Cadre类中还包含数据成员...
分类:其他好文   时间:2015-06-02 09:24:53    阅读次数:161
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!