- 博客(13)
- 资源 (7)
- 收藏
- 关注
原创 Python合并两Excel表格并写入新表格,数据加工统计 ,Python查询目录下所有重复文件并输出路径和名字
(1)查找硬盘中的所有重复文件,并列出每组重复文件中每个文件的文件名、文件大小、位置和创建日期【不是重名文件!!用md5值判断是否是相同文件】import hashlibimport osfrom collections import Counterimport timeimport datetimedef get_md5_01(file_path): md5 = None...
2018-10-18 20:07:56 1316
原创 UPC-9519 New Game(最短路)
题目描述Eagle Jump公司正在开发一款新的游戏。泷本一二三作为其员工,获得了提前试玩的机会。现在她正在试图通过一个迷宫。这个迷宫有一些特点。为了方便描述,我们对这个迷宫建立平面直角坐标系。迷宫中有两条平行直线 L1:Ax+By+C1=0,L2:Ax+By+C2=0,还有 n 个圆 。角色在直线上、圆上、圆内行走不消耗体力。在其他位置上由S点走到T点消耗的体力为S和T的欧几里得距离。泷本...
2018-10-15 00:45:50 170
原创 UPC-3029 Bless You Autocorrect!(字典树+BFS)
Typing on phones can be tedious. It is easy to make typing mistakes, which is why most phones come with an autocorrect feature. Autocorrect not only fixes common typos, but also suggests how to finish t...
2018-10-14 22:43:17 324
原创 Hadoop框架下的HDFS编程:【遍历目录下所有文件】在指定目录下查找包含某一内容的文件,并输出符合条件的文件名
HDFS编程练习,首先要查找某一目录下是否包含某一内容,那么就要做遍历该目录下所有文件的操作。使用Path实例得到目的目录的路径下所有文件的路径,调用listStatus函数得到路径,返回的是一个FileStatus类的数组然后遍历该数组中所有文件的路径,通过getPath方法得到通过FileSystem类对象调用open方法打开数据流要从Hadoop文件系统读取文件,最简单的方法是使用j...
2018-10-13 23:24:56 4991 3
原创 Python五种迭代方式 for循环,列表推导式,内置函数map(),生成器推导式,生成器函数 速度对比
对比了Python3的五种迭代方式进行函数简单计算的花费时间五种迭代分别是,for循环,列表推导式,内置函数map(),生成器推导式,生成器函数简单计算以add()加10操作和abs()绝对值举例运行次数指每个函数执行的次数,默认每个函数对10000个数进行计算。从测试结果可以看出效率从高到低依次为:调用map > 列表解析 > 生成器函数 > 生成器表达式 > ...
2018-10-10 21:28:10 1452
原创 同时安装了Python2和Python3时的pip使用
在我电脑上同时安装了Python2和Python3,当时按正常操作pip的使用默认是直接调用命令pip install + 库名 的,我在只使用Python3时安装request包时如下:直接下载安装,飞一般的感觉。但是当我安装了Python2后,与Python3共存,我默认输入pip install 时,他给我明显默认调用的是Python2的pip:从下载的包名可以看到,pygame...
2018-10-06 21:48:38 17008 2
原创 UPC-2785 One-Way Roads(最大流建图)
题目描述In the country of Via, the cities are connected by roads that can be used in both directions.However, this has been the cause of many accidents since the lanes are not separated: The drivers fre...
2018-10-06 01:06:00 198
原创 UPC-2784 Model Railroad(最小生成树)
题目描述Since childhood you have been fascinated by model railroads. Designing your own tracks,complicated intersections, train stations with miniatures of travellers, train operators, luggage is so much...
2018-10-06 00:31:39 119
原创 【ICPC 2017 Daejeon】UPC-9312 Game Map(dfs)
题目描述The ICPC-World is the most popular RPG game for ACM-ICPC contestants, whose objective is to conquer the world. A map of the game consists of several cities. There is at most one road between a pa...
2018-10-06 00:22:27 556
原创 【ICPC 2015 Shenyang】UVALive - 7239 Bazinga(并查集优化查找子串)
题目描述For n given strings S1 , S2 , … , Sn , labelled from 1 to n, you should find the largest i (1 ≤ i ≤ n) such that there exists an integer j (1 ≤ j < i) such that Sj is not a substring of Si . F...
2018-10-06 00:10:21 180
原创 【ICPC 2015 Shenyang 】UPC-9254 MEETING(最短路&虚点建图)
题目描述Bessie and her friend Elsie decide to have a meeting. However, after Farmer John decorated his fences they were separated into different blocks. John’s farm are divided into n blocks. Bessie live...
2018-10-05 23:49:24 219
原创 UPC-9264 Chip Factory(01字典树)
题目描述John is a manager of a CPU chip factory, the factory produces lots of chips everyday. To manage large amounts of products, every processor has a serial number. More specifically, the factory produ...
2018-10-04 11:46:10 175
原创 【ICPC 2018 Malaysia】UPC-9302 ELI'S CURIOUS MIND(递推)
题目描述Eli is a teenager who loves to study chemistry. She recently joined a chemistry research lab.Dr. Phil wants her to just play around with some chemicals and observe their reaction....
2018-10-04 11:31:48 330
计算机网络双语资料课件课本内容及答案参考
2018-06-06
操作系统精髓与设计原理 第六版课后中文 答案
2018-05-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人