import sys
#import psyco #很奇怪,这题用psyco就runtime error #psyco.full() def z(n): #这个应该是技巧的一种算法
r = 0
while 5 <= n:
n /= 5
r += n
return r def main():
n = int(sys.stdin.readline())
for t in sys.stdin: #这种循环输入一点问题也没
print z(int(t)) #输入的是String, 一定要记得int转化 main() #这种函数架构很科学和良好

///另一种方法

for n in map( int , sys.stdin.read().split() )[1:]: print z( n )

学习

  for t in sys.stdin 这种循环输入可以复用

  这种函数式的架构很科学

  数组初步了解,冒号的使用精髓

    [1:] 躲过了第一个元素(是数量),然后到最后一位元素

错误

  psyco()不总是能用

Factorial Solved Problem code: FCTRL的更多相关文章

  1. Small factorials Solved Problem code: FCTRL2

    import sys def fact(n): final = n while n > 1: final *= n - 1 n -= 1 return final #逻辑严谨,不要忘了retur ...

  2. ATM Solved Problem code: HS08TES

    # ATM import sys withdraw, balance = map(float, sys.stdin.readline().strip().split()) # strip()用法去除结 ...

  3. Double Strings Solved Problem code: DOUBLE

    # Fuking silly, OTZ.... import sys def main(): n = int(raw_input()) for num in sys.stdin: if int(num ...

  4. Enormous Input Test Solved Problem code: INTEST

    import sys import psyco #一键优化库 psyco.full() def main(): n, k = map(int, sys.stdin.readline().strip() ...

  5. Cooking Schedule Problem Code: SCHEDULE(优先队列)

    Cooking Schedule Problem Code: SCHEDULE Chef is a well-known chef, and everyone wishes to taste his ...

  6. Holes in the text Add problem to Todo list Problem code: HOLES

    import sys def count_holes(letter): hole_2 = ['A', 'D', 'O', 'P', 'Q', 'R'] if letter == 'B': return ...

  7. The Lead Game Add problem to Todo list Problem code: TLG

    '''def count_lead(first, second): if first > second: return 1, first - second elif first == secon ...

  8. Turbo Sort Add problem to Todo list Problem code: TSORT

    def heap_sort(ary): n = len(ary) first = int(n / 2 - 1) for start in range(first, -1, -1): # 3~0 rev ...

  9. Use Spring Insight Developer to Analyze Code, Install it with Tomcat, and Extend it with Plugins--转载

    原文地址:http://www.tomcatexpert.com/blog/2012/12/05/use-spring-insight-developer-analyze-code-install-i ...

随机推荐

  1. sizeof用法研究

    一.基础研究 写一个c程序,打印int.long.double型变量所占的字节数.地址.各个字节的地址和内容.打印地址和内容比较好办,打印地址可以用取址符&,打印内容直接输出就行了,那么怎么打 ...

  2. easyUI treeGrid 的小例子

    今天由于业务的需要,于是采用了easyui的的treeGrid控件. <table title="Folder Browser" class="easyui-tre ...

  3. 在ubuntu上编译chrome

    在ubuntu上编译chrome 在ubuntu上编译chrome 红心地瓜 1.获取代码 1)下载tarball,http://chromium-browser-source.commondatas ...

  4. Codeforces Round #277.5 (Div. 2) --E. Hiking (01分数规划)

    http://codeforces.com/contest/489/problem/E E. Hiking time limit per test 1 second memory limit per ...

  5. sicily 1024 Magic Island

    题意:求无向图路径中的最大带权值. 解法:深搜 // Problem#: 9859 // Submission#: 2661875 // The source code is licensed und ...

  6. python部落刷题宝学到的内置函数(二)

    感觉到刷题宝有一个好处,也许也不是好处,它的答案必须是真正输出的值,也就是说应该输出字符串aaaa的时候,答案必须写成界面上返回的值,即'aaaa'.有利于真正记忆返回值类型,但是....太繁琐了 1 ...

  7. The Black Tux | IT桔子

    The Black Tux | IT桔子 The Black Tux theblacktux.com

  8. hadoop-2.6.0为分布式安装

    hadoop-2.6.0为分布式安装 伪分布模式集群规划(单节点)------------------------------------------------------------------- ...

  9. hdu 5389 Zero Escape(记忆化搜索)

    Problem Description Zero Escape, is a visual novel adventure video game directed by Kotaro Uchikoshi ...

  10. 自定义枚举类型的常用操作-附源码(xjl456852原创)

    自定义枚举类型中,假如我们有name和desc这样的属性,并在这个基础上定义了多个对象. 那么就可能用到通过name获取desc,或者通过desc获取name.通过name或者desc获取对应的枚举对 ...