![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
scriptkids
a normal university student
展开
-
zoj 1797 python
<br />这个。。输入输出。。zoj上的只支持sys.stdin有点小麻烦。。<br />import sysdef readNum(): line = sys.stdin.readline() a = line.split() n = int (a[0]) return ndef gcd(x,y): if x<y: tmp=x x=y y=tmp if y==0:原创 2011-05-11 13:58:00 · 964 阅读 · 0 评论 -
zoj 1970
<br />import sysfor line in sys.stdin: line=line.split() count = 0 for i in line[1]: if line[0][count]==i: count+=1 if count>=len(line[0]): break if count>=len(line[0]): pri原创 2011-05-16 10:35:00 · 672 阅读 · 0 评论 -
zoj 1392
<br />import sys for L in sys.stdin: line=L.split() if line[0]=='ENDOFINPUT' and len(line)==1: break if line[0]=='START' and len(line)==1: continue if line[0]=='END' and len(line)==1: continue for i in原创 2011-05-15 01:06:00 · 610 阅读 · 0 评论 -
zoj 1577
<br />超时数次。。终于900ms过了。。。<br />import sysimport mathdef GCD(x,y): if y==0: return x else: return GCD(y,x%y)for line in sys.stdin: line=line.split() count=0 n1=int(line[0]) n2=int(line[1]) if n1==n2:原创 2011-05-15 02:32:00 · 619 阅读 · 0 评论 -
zoj 1109
<br />import sysD={}count=0for line in sys.stdin: line=line.split() #print line if len(line)==0: #print line count+=1 continue if count==0: #tmp='line[1]' D[line[1]]=line[0] #原创 2011-05-15 00:25:00 · 756 阅读 · 0 评论 -
zoj 1025 python
<br /> 好吧。。才知道zoj的题目ac人数的排名是一页一页算的。。。这么水的题俺竟然木作。。<br />import sysl=sys.stdin.readline()k=l.split()n=int(k[0])for i in range(n): l=sys.stdin.readline() for j in range(len(l)): sys.stdout.write(l[len(l)-j-2])<br />用了分片的代码。<br />im原创 2011-05-12 01:16:00 · 603 阅读 · 0 评论 -
zoj 1295 python
<br /> 好吧。。才知道zoj的题目ac人数的排名是一页一页算的。。。这么水的题俺竟然木作。。<br />import sysl=sys.stdin.readline()k=l.split()n=int(k[0])for i in range(n): l=sys.stdin.readline() for j in range(len(l)): sys.stdout.write(l[len(l)-j-2])<br />用了分片的代码。<br />im原创 2011-05-12 01:15:00 · 573 阅读 · 0 评论 -
zoj 2829 python
<br />import sysK=[]i=3def readNum(): l=sys.stdin.readline() l.split() return int(l[0])while True: if i%3==0 or i%5==0: K.append(i) i+=1 if len(K)>=100002: breakfor line in sys.stdin.readlines():原创 2011-05-11 23:37:00 · 977 阅读 · 0 评论 -
zoj 1045 python
<br />import sysi=1L=[]tmp=0while i<500: i+=1 tmp=tmp+1.0/i L.append(tmp)for line in sys.stdin: n = line.split() if((float)(n[0])==0.00): break for i in range(480): if L[i]>(float)(n[0]): print i+1, break print "card(s原创 2011-05-11 13:59:00 · 665 阅读 · 0 评论 -
zoj 2191
<br /> 校园网到期了。。。。网通访问csdn 无限的400 。。所以这几天就没写blog<br />import sysfor line in sys.stdin: line=line.split() a=int(line[0]) b=int(line[1]) c=int(line[2]) print a-3*b+3*c,3*a-8*b+6*c,6*a-15*b+10*c<br />原创 2011-05-21 12:21:00 · 629 阅读 · 0 评论