上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 29 下一页
摘要: Description 农民约翰有三个容量分别是A,B,C升的桶,A,B,C分别是三个从1到20的整数,最初,A和B桶都是空的,而C桶是装满牛奶的。有时,约翰把牛奶从一个桶倒到另一个桶中,直到被灌桶装满或原桶空了。当然每一次灌注都是完全的。由于节约,牛奶不会有丢失。 写一个程序去帮助约翰找出当A桶是 阅读全文
posted @ 2018-09-05 19:46 王陸 阅读(681) 评论(2) 推荐(0) 编辑
摘要: Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these 阅读全文
posted @ 2018-09-02 15:00 王陸 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Description Given a positive integer N, you should output the leftmost digit of N^N. Description Given a positive integer N, you should output the lef 阅读全文
posted @ 2018-09-01 13:15 王陸 阅读(563) 评论(0) 推荐(1) 编辑
摘要: Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But androids have to go to school to be able to solve 阅读全文
posted @ 2018-08-31 12:53 王陸 阅读(446) 评论(0) 推荐(0) 编辑
摘要: Description N 的阶乘写作N!表示小于等于N的所有正整数的乘积。阶乘会很快的变大,如13!就必须用32位整数类型来存储,70!即使用浮点数也存不下了。你的任务是 找到阶乘最后面的非零位。举个例子,5!=1*2*3*4*5=120所以5!的最后面的非零位是2,7!=1*2*3*4*5*6* 阅读全文
posted @ 2018-08-30 11:31 王陸 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 这篇博客主要转自《啊哈!算法》http://developer.51cto.com/art/201403/430986.htm 高快省的排序算法 有没有既不浪费空间又可以快一点的排序算法呢?那就是“快速排序”啦!光听这个名字是不是就觉得很高端呢。 假设我们现在对“6 1 2 7 9 3 4 5 10 阅读全文
posted @ 2018-08-30 08:01 王陸 阅读(758) 评论(0) 推荐(0) 编辑
摘要: Description 一天,一只住在 501 实验室的皮卡丘决定发奋学习,成为像 LeiQ 一样的巨巨,于是他向镇上的贤者金桔请教如何才能进化成一只雷丘。 金桔告诉他需要进化石才能进化,并给了他一个地图,地图上有 n 个小镇,他需要从这些小镇中收集进化石。 接下来他会进行 q 次操作,可能是打听进 阅读全文
posted @ 2018-08-29 21:40 王陸 阅读(367) 评论(0) 推荐(0) 编辑
摘要: Description Big Johnsson Trucks Inc. is a company specialized in manufacturing big trucks. Their latest model, the Godzilla V12, is so big that the am 阅读全文
posted @ 2018-08-29 20:15 王陸 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Description Several startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many nodes that act 阅读全文
posted @ 2018-08-29 10:28 王陸 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, an 阅读全文
posted @ 2018-08-28 21:03 王陸 阅读(423) 评论(0) 推荐(0) 编辑
摘要: Description Rudolf is on his way to the castle. Before getting into the castle, the security staff asked him a question: Given two binary numbers aa a 阅读全文
posted @ 2018-08-28 10:26 王陸 阅读(613) 评论(0) 推荐(1) 编辑
摘要: 按照Linux系统之后再切换回到win10后,我发现win10的时间不再是北京时间,而是比北京时间多了整整8小时,之后百度找到了问题来源,这里给出解决方法。 如果安装了 Windows 和 Linux(比如 Ubuntu)双系统,有时会出现两个系统的时间不一致的情况。这是因为,两个操作系统对电脑硬件 阅读全文
posted @ 2018-08-26 20:45 王陸 阅读(2820) 评论(0) 推荐(0) 编辑
摘要: 之前在win10下安装了深度系统,我不知道其他人在双系统切换的时候是否需要更改BIOS参数,我根据我的实际情况给出双系统切换设置的解决方案。 1.开机后进入选项System setup 2.按照下图选择参数,进入深度系统选择AHCI,进入win10选择Intel 。 3.继续选择Security—S 阅读全文
posted @ 2018-08-26 20:34 王陸 阅读(28471) 评论(0) 推荐(1) 编辑
摘要: Description You are given an integer N. Consider all possible segments (线段,划分)on the coordinate axis with endpoints at integer points with coordinates 阅读全文
posted @ 2018-08-22 19:43 王陸 阅读(594) 评论(0) 推荐(0) 编辑
摘要: 1.定义 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 举个例子: 标准列是1 2 3 4 5 那么 5 4 3 2 1 的逆序数算法: 看第二个,4之前有一个5,在标准列中5在4的后面,所以记1个 类 阅读全文
posted @ 2018-08-21 17:44 王陸 阅读(4718) 评论(0) 推荐(1) 编辑
摘要: Description 2005年11月份,我们学校参加了ACM/ICPC 亚洲赛区成都站的比赛,在这里,我们获得了历史性的突破,尽管只是一枚铜牌,但获奖那一刻的激动,也许将永远铭刻在我们几个人的心头。借此机会,特向去年为参加ACM亚洲赛而艰苦集训了近半年的各位老队员表示感谢。 实际上,除了获奖以外 阅读全文
posted @ 2018-08-20 09:50 王陸 阅读(614) 评论(0) 推荐(0) 编辑
摘要: 这篇博客主要参考刘汝佳的《算法竞赛入门经典》。 下面是一个杨辉三角: 我们再把(a+b)n展开,将得到一个关于x的多项式: (a+b)0 = 1 (a+b)1 = a + b (a+b)2 = a2 + 2ab + b2 (a+b)3 = a3 + 3a2b + 3ab2 + b3 (a+b)4 = 阅读全文
posted @ 2018-08-19 20:44 王陸 阅读(4376) 评论(0) 推荐(0) 编辑
摘要: Description A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves tha 阅读全文
posted @ 2018-08-19 17:28 王陸 阅读(839) 评论(0) 推荐(0) 编辑
摘要: Description A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. 阅读全文
posted @ 2018-08-19 11:06 王陸 阅读(547) 评论(0) 推荐(0) 编辑
摘要: Description Pig is visiting a friend. Pig's house is located at point 0, and his friend's house is located at point m on an axis. Pig can use teleport 阅读全文
posted @ 2018-08-18 19:09 王陸 阅读(521) 评论(0) 推荐(0) 编辑
摘要: 一、爬⾍概述 什么是爬⾍? 不知道各位是否遇到过这样的需求. 就是我们总是希望能够保存互联⽹上的⼀些重要的数据信息为⼰所⽤.⽐如, 在浏览到⼀些优秀的让⼈⾎脉喷张的图⽚时. 总想保存起来留为⽇后做桌⾯上的壁纸 在浏览到⼀些重要的数据时(各⾏各业), 希望保留下来⽇后为⾃⼰进⾏各种销售⾏为增光添彩 在 阅读全文
posted @ 2018-08-18 16:25 王陸 阅读(718) 评论(0) 推荐(0) 编辑
摘要: 我对Python网络爬虫的学习主要是基于中国慕课网上嵩天老师的讲授,写博客的目的是为了更好触类旁通,并且作为学习笔记之后复习回顾。 1.引言 requests 库是一个简洁且简单的处理HTTP请求的第三方库。 requests的最大优点是程序编写过程更接近正常URL 访问过程。 这个库建立在Pyth 阅读全文
posted @ 2018-08-18 10:06 王陸 阅读(1577) 评论(0) 推荐(0) 编辑
摘要: 转载自https://www.cnblogs.com/hanmk/p/8724162.html 学习爬虫,怎么也绕不开requests库和BeautifulSoup库,先说下BeautifulSoup库: BeautifulSoup库通俗来说是【解析、遍历、维护“标签树”(例如html、xml等格式 阅读全文
posted @ 2018-08-17 21:36 王陸 阅读(1210) 评论(0) 推荐(0) 编辑
摘要: Description You are given a rooted tree with n vertices. The vertices are numbered from 1 to n, the root is the vertex number 1. Each vertex has a col 阅读全文
posted @ 2018-08-17 20:44 王陸 阅读(1191) 评论(0) 推荐(0) 编辑
摘要: 一、jieba库基本介绍 (1)、jieba库概述 jieba是优秀的中文分词第三方库 - 中文文本需要通过分词获得单个的词语 - jieba是优秀的中文分词第三方库,需要额外安装 - jieba库提供三种分词模式,最简单只需掌握一个函数 (2)、jieba分词的原理 Jieba分词依靠中文词库 - 阅读全文
posted @ 2018-08-16 14:42 王陸 阅读(153530) 评论(12) 推荐(46) 编辑
摘要: 写这篇博客的目的是为了更好利用数学方法来处理数据,之前遇到了一道题给你a,b,c三个数问a/b小数点后几位是c,按照我的想法肯定是现将a/b的结果使用函数转换成字符串,然后直接在字符串中查找,很遗憾对于数据量较大的数根本就不能通过,还好这道水题是我队友AC通过了,这道题到我手里肯定是通不过的,那我们 阅读全文
posted @ 2018-08-15 21:11 王陸 阅读(1839) 评论(2) 推荐(0) 编辑
摘要: Description Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triple 阅读全文
posted @ 2018-08-15 11:00 王陸 阅读(2466) 评论(0) 推荐(0) 编辑
摘要: 这篇博客转自爱国师哥,这里给出连接https://www.cnblogs.com/aiguona/p/7281856.html 一.解释 以前遇到二分的题目都是手动实现二分,不得不说错误比较多,关于返回值,关于区间的左闭右开等很容易出错,最近做题发现直接使用STL中的二分函数方便快捷还不会出错,不过 阅读全文
posted @ 2018-08-14 17:21 王陸 阅读(61022) 评论(10) 推荐(20) 编辑
摘要: Description Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin lett 阅读全文
posted @ 2018-08-14 07:34 王陸 阅读(419) 评论(0) 推荐(1) 编辑
摘要: Description Allen wants to enter a fan zone(球迷区) that occupies a round square and has nn entrances. There already is a queue of aiai people in front o 阅读全文
posted @ 2018-08-13 21:36 王陸 阅读(569) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 29 下一页