码迷,mamicode.com
首页 >  
搜索关键字:rmq range minimummax    ( 10438个结果
python输出乘法口诀
for i in range(1,10): for j in range(1,i+1): print (" ".join(["%d*%d=%d" %(j,i,i*j)]))[root@miller qinbin]# python test.py 1*1=11*2=2 2*2=41*3=3 2...
分类:编程语言   时间:2014-05-26 20:34:16    阅读次数:388
Python重写C语言程序100例--Part8
''' 【程序61】 题目:打印出杨辉三角形(要求打印出10行如下图)    1.程序分析: ''' if __name__ == '__main__': a = [] for i in range(10): a.append([]) for j in range(10): a[i].append(0) for i...
分类:编程语言   时间:2014-05-25 00:52:00    阅读次数:436
趣味编程:静夜思(Java8版)
import java.util.stream.*; class KV{ String ch; int id; } public class Test { private static void print(String text, int offset) { IntStream.range(0, text.length()) .mapToObj(i -> new KV(){{c...
分类:编程语言   时间:2014-05-24 22:09:03    阅读次数:363
Python重写C语言程序100例--Part10
''' 【程序81】 题目:809*??=800*??+9*??+1 其中??代表的两位数,8*??的结果为两位数,9*??的结果为3位数。求??代表的两位数,及809*??后的结果。 1.程序分析: 2.程序源代码 这个程序实在是奇怪 0 = 1 :( 就写个程序而已,不去追究了 ''' a = 809 for i in range(10,100): b = i * a + 1 ...
分类:编程语言   时间:2014-05-24 14:15:21    阅读次数:321
【STL基础】list
list构造函数://default:list l; //空的list//fill:list l(n); //n个元素, 元素默认初始化list l(n, value); //n个元素值为value//range:list l(fir...
分类:其他好文   时间:2014-05-23 09:49:56    阅读次数:314
Nginx是如何实现轻量级和高并发
Linux系统通过软限制和硬限制,制约了打开文件的最大个数,而且每个端口侦听的连接数受限于/etc/sytctl.conf中的ip_local_port_range的范围,那么nginx是如何做到轻量级和高并发的。      Nginx的进程模型            各个work进程间通过accept_mutex互斥锁进行连接的获取,以防止惊群现象的发生(即所有进程都收到通知,却...
分类:其他好文   时间:2014-05-22 17:11:39    阅读次数:364
每日算法之十一:Integer to Roman
题目:Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 罗马表示方式如下: I = 1; V = 5; X = 10; L = 50; C = 100; D = 500; M = 1000; 其中每...
分类:其他好文   时间:2014-05-22 13:00:09    阅读次数:240
LeetCode: Search for a Range [033]
【题目】 Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found in the array, return [-1, -1]. For example, Given [5...
分类:其他好文   时间:2014-05-22 06:44:39    阅读次数:265
OpenStack-Heat中的Autoscaling - AWS的autoscaling
在Heat中完全使用aws的语法创建一套autoscaling的template。 流程: Create LaunchConfig (Create basic instance, send mem status to ALARM) -> Create ASGroup (Define instance num range) -> Create ScaleUpPolicy (+1 in...
分类:其他好文   时间:2014-05-21 16:01:10    阅读次数:315
【Error】Python:ascii codec can't decode byte 0xe8 in position 0:ordinal not in range(128)
最近编写Python程序时经常遇见中文相关的问题,这里说一个问题的解决方法。 我在使用json模块的dumps()函数时,因为涉及到中文,报出如下错误: ascii codec can't decode byte 0xe8 in position 0:ordinal not in range(128) 这是编码相关的问题,在该程序中加入如下代码: import sys reload(sys) sys.setdefaultencoding('utf-8') 这样就可以解决该问题了,希望对大家有所帮助。...
分类:编程语言   时间:2014-05-21 09:47:21    阅读次数:323
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!