This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # todo | |
| import re | |
| from logging import debug | |
| import logging | |
| logging.basicConfig(level=logging.DEBUG) | |
| n,m,q=[int(i) for i in input().strip("\n").split()] | |
| debug("n:{n} m:{m} q:{q}".format(n=n,m=m,q=q)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 阅文 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 逆序 单词 | |
| """ | |
| s=input() | |
| if len(s)==0: | |
| print("") | |
| else: | |
| enddot=False | |
| if s[-1]==".": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 计算字符串转换的最短距离 | |
| """ | |
| def minDistance(word1, word2): | |
| n = len(word1) | |
| m = len(word2) | |
| if n * m == 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 求不大于n的所有数质数分解后的质数总个数 | |
| 快手笔试第3题 | |
| """ | |
| from random import randint | |
| def quickMulMod(a,b,m): | |
| ret = 0 | |
| while b: | |
| if b&1: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 给定数独板,检测数独是否正确 | |
| 快手笔试题4 | |
| """ | |
| class E(Exception): | |
| pass | |
| def valid(l): | |
| d={} | |
| for v in l: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 58 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| "math" | |
| ) | |
| func fib(N int) int { | |
| N=N-1; | |
| s5:=math.Sqrt(5); | |
| return int(math.Round((math.Pow((1+s5)/2 , float64(N+1)) - math.Pow((1-s5)/2, float64(N+1))) /s5)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os,sys | |
| flist=[] | |
| with open("/home/rui/tmp/sflist.txt") as fp: | |
| for l in fp.readlines(): | |
| l2=l.strip() | |
| if l2=="#END": | |
| break | |
| flist.append(l2) | |
| with open("/home/rui/tmp/output.txt","w") as fpo: |