牛客616244708号
牛客616244708号
全部文章
分类
题解(11)
归档
标签
去牛客网
登录
/
注册
牛客616244708号的博客
全部文章
(共10篇)
题解 | #走方格的方案数#
def func(n,m): dp = [[1]*(m+1) for i in range(n+1)] for i in range(1,n+1): for j in range(1,m+1): dp[i][j] = dp[i][j-1] + ...
2021-08-15
0
292
题解 | #查找组成一个偶数最接近的两个素数#
#素数除2之外都是奇数,找出n以内的所有素数,二者之和为n且二者之差最小! #x为其中一个数,则n-x是另一个数,二者之差(n-x)-x = n-2*x x <= n//2 def func(x): for i in range(2,x): if i*i <...
2021-08-14
0
282
题解 | #字符串加密#
def fun(key, s): alphabet = 'abcdefghijklmnopqrstuvwxyz' key = key.lower() newkey = '' newalphabet = alphabet #得到密钥 for i, k i...
2021-08-13
0
308
题解 | #密码验证合格程序#
import sys def check_type(passwd): #检查类型是否多于等于3 type_set = set() for i in passwd: if i.isdigit(): #是否有数字 ...
2021-08-09
0
309
题解 | #求最小公倍数#
while True: try: string = input() for i in string: if i in ['$','*','!','#']: string = string.replace(...
2021-08-04
0
255
题解 | #求最小公倍数#
while True: try: a,b = map(int,input().strip().split()) c = a * b m = max(a,b) n = min(a,b) list1 = [] ...
2021-08-04
1
401
题解 | #等差数列#
while True: try: n = int(input()) temp = [] while len(temp) < n: for i in range(n): x = 2 +...
2021-08-04
0
278
题解 | #自守数#
def func(x): a = str(x * x) b = len(str(x)) if x == int(a[-b:]): return True else: return False while True: ...
2021-08-04
0
456
题解 | #完全数计算#
def func(x): temp = [] for i in range(1,x): &nbs...
2021-08-01
0
279
题解 | #坐标移动#
python3 str1 = input().strip().split(';') x,y = (0,0) for i in str1: if (len(i)==2 or len(i)==3) and (i[0] in ['A','S','D','W']) and i[1:].isdigit...
2021-07-20
0
311