1 #include 2 void PP(int n) 3 { 4 if(n==0) return; 5 PP(n/10); 6 printf("%d",n%10); 7 } 8 void NP(int n) 9 {10 if(n==0) return;11 ...
分类:
其他好文 时间:
2015-04-25 19:44:36
阅读次数:
115
Negative and Positive (NP)
Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2846 Accepted Submission(s): 782
Problem Description
When given...
分类:
其他好文 时间:
2015-04-23 13:33:13
阅读次数:
135
The 3n + 1 problem
Background
Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will b...
分类:
其他好文 时间:
2015-04-20 18:30:43
阅读次数:
175
matplot 代码实例#!/usr/bin/env python# coding=utf-8import numpy as npimport matplotlib.pyplot as pltax = plt.subplot(111)t = np.arange(0,5,0.01)s = np.cos...
分类:
其他好文 时间:
2015-04-18 12:50:38
阅读次数:
213
本节主要解决在一个figure中放置多福图,以及图中一些注释文字的添加等问题。先看一个效果图:下面是实现代码:__author__ = 'hust'import numpy as npimport matplotlib.pyplot as pltdef f(t): return np.exp(...
分类:
其他好文 时间:
2015-04-16 19:34:21
阅读次数:
138
1.图灵停机问题:无论在多长时间内都无法被任何一台计算机解决问题描述:问题为H,H的输入数据为P(P是一段程序(程序也是一串字符串数据)),判定P在输入w下是否能够最终停止H(P(w))=0 若P在输入w下可停机 -1 若P在输入w下死循环(H的输出为状态)分析:假设问题H可解,则构造一...
分类:
其他好文 时间:
2015-04-13 22:23:08
阅读次数:
124
欧几里得旅行商问题是一个NP问题,问题描述:平面上n个点,确定一条连接各点的最短闭合旅程。所以通常会简化为双调欧几里得问题来求一个近似解,借用下算法导论的图,如下所示a)是一个最优欧几里得b)为双调路线,从最左点开始严格向右至最右点通过动态规划求解,首先需要分析子问题:双调路径为 i -> 0,0 ...
分类:
其他好文 时间:
2015-04-08 10:48:41
阅读次数:
316
#!/usr/bin/env python
import numpy as np
from datetime import datetime
#fl = open('te.csv')
#item_id,item_geohash,item_category
fl = open('tianchi_mobile_recommend_train_user.csv')
#user_id,item...
分类:
其他好文 时间:
2015-04-03 09:26:50
阅读次数:
154
#!/usr/bin/env python
import numpy as np
fl = open('te.csv')
try:
text = fl.readline( )
finally:
print text
#fl.close( )
#print text
#data = np.loadtxt("\usr\data\tianchi_mobile_recomm...
分类:
编程语言 时间:
2015-04-02 09:08:44
阅读次数:
195
wget -e robots=off -w 1 -xq -np -nH -pk -m -t 1 -P "$PATH" "$URL"
使用wget工具抓取网页和图片:
包括css\js\html\图片文件...
分类:
Web程序 时间:
2015-04-01 19:59:57
阅读次数:
203