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
| """ | |
| 求不大于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
| """ | |
| 计算字符串转换的最短距离 | |
| """ | |
| 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
| """ | |
| 逆序 单词 | |
| """ | |
| 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
| 阅文 |
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
| #todo |
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 re | |
| from logging import debug | |
| import logging | |
| # logging.basicConfig(level=logging.DEBUG) | |
| n=int(input()) | |
| sl=input() | |
| l=[int(s) for s in re.split(r"\s",sl.strip("\n").strip(" "))] | |
| # debug(f"n={n} l={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
| from queue import Queue | |
| s=input().strip("\n") | |
| l=len(s) | |
| q=Queue() | |
| # flag | |
| # 0: nothing | |
| # 1: in 1 | |
| # 2: in 2 | |
| q.put(("",0,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
| <?xml version="1.0" encoding="utf-8"?> | |
| <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en"> | |
| <!-- This style was edited with the Visual CSL Editor (http://editor.citationstyles.org/visualEditor/) --> | |
| <info> | |
| <title>Journal of Software (numeric, Chinese)</title> | |
| <id>http://www.zotero.org/styles/journal-of-software</id> | |
| <link rel="self" href="http://www.zotero.org/styles/journal-of-software"/> | |
| <link rel="template" href="http://www.zotero.org/styles/chinese-gb7714-2005-numeric"/> | |
| <link href="http://gradschool.ustc.edu.cn/ylb/material/xw/wdxz/19.pdf" rel="documentation"/> | |
| <author> |