Factorial Solved Problem code: FCTRL
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的更多相关文章
- Small factorials Solved Problem code: FCTRL2
import sys def fact(n): final = n while n > 1: final *= n - 1 n -= 1 return final #逻辑严谨,不要忘了retur ...
- ATM Solved Problem code: HS08TES
# ATM import sys withdraw, balance = map(float, sys.stdin.readline().strip().split()) # strip()用法去除结 ...
- 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 ...
- Enormous Input Test Solved Problem code: INTEST
import sys import psyco #一键优化库 psyco.full() def main(): n, k = map(int, sys.stdin.readline().strip() ...
- Cooking Schedule Problem Code: SCHEDULE(优先队列)
Cooking Schedule Problem Code: SCHEDULE Chef is a well-known chef, and everyone wishes to taste his ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- Sicily 1133. SPAM
题目地址:1133. SPAM 思路: 题目意思是说在‘@’的前后出现题目给定的合法字符或者不连续出现‘.’字符的话,这个就是合理的输出. 那么以@为中心,向前,向后扫描,当扫描到不符合字符时,记录此 ...
- PHP 中的超全局变量
(1)$_GET[].一个包含所有PHP 从客户端浏览器接收的GET变量的数组. (2)$_POST[].一个包含所有PHP 从客户端浏览器接收的POST变量的数组. (3)$_COOKIE[].一个 ...
- android ftp案例分析
使用方法: FTPClient client = new FTPClient(); client.connect("ftp.host.com", 8021); client.log ...
- ural 1052 Rabbit Hunt
http://acm.timus.ru/problem.aspx?space=1&num=1052 #include <cstdio> #include <cstring&g ...
- 向PE文件中添加一个Section
背景 之前说过直接向类HelloWorld.exe的可执行文件添加一个MessageBox弹窗, 但有时候, 需要添加的内容太多了, 因为数据与代码一起插入, 以至于可执行文件本身没有足够的空闲空间存 ...
- Android ContentProvider完整案例
ContentData类,提供数据常量: /** * 提供ContentProvider对外的各种常量,当外部数据需要访问的时候,就可以参考这些常量操作数据. * @author HB * */ pu ...
- office web apps server 问题和解决办法
New-OfficeWebAppsFarm –InternalURL "http://owa.zjkhlib.com" –AllowHttp –EditingEnabled 错误1 ...
- 基于网络的服装定制MTM系统研究 - 硕士论文 - 道客巴巴
国内的mtm系统_百度搜索 基于网络的服装定制MTM系统研究 - 硕士论文 - 道客巴巴 PDF文档(共76页) - 下载需1800积分 天津工业大学 硕士学位论文基于网络的服装定制MTM系统研究 姓 ...
- C - Critical Links - uva 796(求桥)
题意:有一些网络通过一些线路连接,求关键的连接,也就是桥,如果删除这个链接那么会产生两个子树 分析:注意一下图不是连通图即可 ************************************* ...
- ELT工具Kettle之CDC(Change Data Capture)实现实例
ETL过程的第一步就是从不同的数据源抽取数据并把数据存储在数据的缓存区.这个过程的主要挑战就是初始加载数据量大和比较慢的网络延迟.在初始加载完成之后,不能再把所有数据重新加载一遍,我们需要的只是变化的 ...