自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 问答 (1)
  • 收藏
  • 关注

原创 【POJ 3311】 Hie with the Pie 状态压缩DP

DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries. ...

2019-04-17 17:20:40 145

原创 【POJ 3254】 Corn Fields (入门状态压缩DP)

DescriptionFarmer John has purchased a lush new rectangular pasture composed ofMbyN(1 ≤M≤ 12; 1 ≤N≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. ...

2019-04-17 12:21:13 163

原创 [UVa1218/POJ3398] Perfect Service (树形DP)

DescriptionA network is composed ofNcomputers connected byN− 1 communication links such that any two computers can be communicated via a unique route. Two computers are said to beadjacentif th...

2019-03-28 02:36:10 227

原创 Sklearn习题 [python]

题目:代码:from sklearn import datasets from sklearn import cross_validation from sklearn.naive_bayes import GaussianNB from sklearn.svm import SVC from sklearn.ensemble import RandomForestClassifi...

2018-06-21 00:35:56 373

原创 Pandas 练习题 [python]

Anscombe's quartetAnscombe's quartet comprises of four datasets, and is rather famous. Why? You'll find out in this exercise.In [4]:anascombe = pd.read_csv('data/anscombe.csv')anascombe.head()Out[4]...

2018-06-20 18:57:36 2960

原创 Scipy 练习题 [python]

import numpy as npimport scipy.linalg as slm, n = 10, 9A = np.random.random((m,n)) b = np.random.random(m) x = sl.lstsq(A, b)[0]print(np.linalg.norm(x))import numpy as npimport scipy.optimiz...

2018-06-02 22:39:09 532

原创 Matplotlib 练习题 [python]

import numpy as np import matplotlib.pyplot as pltx = np.linspace(0,2,100)y = np.power(np.sin(x - 2), 2) * np.exp(-np.power(x, 2))f, ax=plt.subplots(1, 1, figsize=(5,4))ax.plot(x, y)ax.set_xli...

2018-06-02 21:29:54 869

原创 Numpy 练习题 [python]

Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A ∈ Rn×m and B ∈ Rm×m, for n = 200, m = 500.Exercise 9.1  Matrix operationsCalculate A + A, AA^T, A^TA and AB. Write a fu...

2018-05-22 12:00:51 524

原创 LeetCode 120. Triangle [python3/C++]

一 题目Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,5,...

2018-05-04 04:19:34 117

原创 LeetCode 79. Word Search [python3/C++]

转载请注明出处: https://blog.csdn.net/yyying2016/article/details/80174304一 题目Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent...

2018-05-03 15:25:40 256

原创 LeetCode 55. Jump Game [python3/C++]

转载请注明出处:https://blog.csdn.net/yyying2016/article/details/80170344一 题目Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array rep...

2018-05-02 19:29:05 237

原创 LeetCode 84. Largest Rectangle in Histogram [python3/C++]

转载请注明出处:https://blog.csdn.net/yyying2016/article/details/80119171一 题目:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest r...

2018-04-28 16:25:52 376

原创 高级编程技术 week5 第十章

10-1 Python学习笔记:在文本编辑器中新建一个文件,写几句话来总结一下你至此学到的Python知识,其中每一行都以“In Python you can”打头。将这个文件命名为learning_python.txt,并将其存储到为完成本章练习而编写的程序所在的目录中。编写一个程序,它读取这个文件,并将你所写的内容打印三次:第一次打印时读取整个文件;第二次打印时遍历文件对象;第三次打印时将各行...

2018-04-09 11:54:21 149

原创 高级编程技术 week5 第九章

9-1餐馆:创建一个名为Restaurant 的类,其方法__init__()设置两个属性:restaurant_name 和cuisine_type。创建一个名为describe_restaurant()的方法和一个名为open_restaurant()的方法,其中前者打印前述两项信息,而后者打印一条消息,指出餐馆正在营业。class Restaurant(): def __init__...

2018-04-08 15:47:15 194

原创 高级编程技术 week4 第八章

8-1 消息:编写一个名为display_message() 的函数,它打印一个句子,指出你在本章学的是什么。调用这个函数,确认显示的消息正确无误。def display_message(): print('I am learning function') display_message() 8-2 喜欢的图书:编写一个名为favorite_book()的函数,其中包含一个名为t...

2018-04-02 02:02:09 169

原创 高级编程技术 week4 第七章

7-1 汽车租赁:编写一个程序,询问用户要租赁什么样的汽车,并打印一条消息,如“Let me see if I can find you a Subaru”。car = input("What kind of car do you want?")print("Let me see if I can find you a %s"%car)7-2 餐馆订位:编写一个程序,询问用户有多少人用餐。如果超...

2018-03-26 20:40:09 152

原创 高级编程技术 week3 第六章

6-1 人:使用一个字典来存储一个熟人的信息,包括名、姓、年龄和居住的城市。该字典应包含键first_name、last_name、age和city。将存储在该字典中的每项信息都打印出来。person = {'first_name' : 'Ming', 'last_name' : 'Li', 'age' : 19, 'city' : 'Guangzhou'}print(person['first...

2018-03-21 20:29:17 226

原创 高级编程技术 week3 第五章

5-1 条件测试:编写一系列条件测试;将每个测试以及你对其结果的预测和实际结果都打印出来。你编写的代码应类似于下面这样:car = 'subaru'print("Is car == 'subaru'? I predict True.")print(car == 'subaru')print("\nIs car == 'audi'? I predict False.")print(car == 'a...

2018-03-19 08:49:08 536

原创 高级编程技术 week2 第四章

第四章习题4-1 比萨:想出至少三种你喜欢的比萨,将其名称存储在一个列表中,再使用for循环将每种比萨的名称都打印出来。    1)修改这个for循环,使其打印包含比萨名称的矩阵,而不仅仅是比萨的名称。对于每种比萨,都显示一行输出,如“I like pepperoni pizza”。    2)在程序末尾添加一行代码,它不在for循环中,指出你有多喜欢比萨。输出应包含针对每种比萨的消息,还有一个总...

2018-03-15 01:11:58 249

原创 高级编程技术 week2 第三章

第三章习题3-1 姓名:将一些朋友的姓名存储在一个列表中,并将其命名为names。依次访问该列表中的每个元素,从而将每个朋友的姓名都打印出来。names = ["Tom", "Bob", "Jessie", "Jack"]print(names[0])print(names[1])print(names[2])print(names[3])3-2 问候语: 继续使用练习3-1中的列表,但...

2018-03-13 00:44:56 238

原创 高级编程技术 week1 第二章

1、浏览Python主页(https://www.python.org/)的发现和收获在python主页中,可以看到"关于"、"下载"、"文档"、"社区"等选项1)在Downloads中可以选择下载Windows、Mac OS X、其他等版本,也可以下载源代码;2)在Documentation中可以看到初学者指南、常见问题、python书籍、python随笔等内容;3)在community中可以进...

2018-03-12 00:33:14 131

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除