BSF
BSF
全部文章
题解
归档
标签
去牛客网
登录
/
注册
BSF的博客
全部文章
/ 题解
(共81篇)
题解 | #密码截取#
while True: try: s = input() L = len(s) if L < 2: print(L) # 初始化二维数组dp dp = [[False] * L fo...
Python3
2021-10-18
0
519
题解 | #输出单向链表中倒数第k个结点#
while True: try: n, nums, k = int(input()), input().split(), int(input()) if k: print(nums[n-k]) else: ...
Python3
2021-10-18
16
1423
题解 | #计算字符串的距离#
while True: try: s1, s2 = input(), input() n1, n2 = len(s1), len(s2) # 初始化数组dp dp = [[0] * (n2+1) for _ in range(n...
Python3
2021-10-18
4
1046
题解 | #输入n个整数,输出其中最小的k个#
while True: try: n, k = map(int, input().split()) nums = map(int, input().split()) for n in sorted(nums)[:k]: ...
Python3
2021-10-18
0
549
题解 | #查找兄弟单词#
while True: try: lst = input().split() words, x, k = lst[:-2], lst[-2], int(lst[-1]) bros = [] for w in words: ...
Python3
2021-10-18
0
353
题解 | #统计字符#
while True: try: s = input() dic = { 'letter' : 0, 'space' : 0, 'num' : 0, 'other' ...
Python3
2021-10-18
0
396
题解 | #坐标移动#
while True: try: lst = list(filter(lambda x : 2<= len(x) <= 3, input().split(';'))) pos = [0, 0] for i in lst: ...
Python3
2021-10-18
0
459
题解 | #统计每个月兔子的总数#
def fn(n): if n == 1 or n == 2: return 1 return fn(n-1) + fn(n-2) while True: try: n = int(input()) print(fn(n)) ...
Python3
2021-10-17
3
482
题解 | #输入整型数组和排序标识,对其元素按照升序或降序进行排序#
while True: try: n = int(input()) nums = map(int, input().split()) mode = int(input()) # 降序 if mode: ...
Python3
2021-10-17
0
388
题解 | #字符串加密#
letters = 'abcdefghijklmnopqrstuvwxyz' while True: try: word, s = input(), input() key = '' # 去重 for c in word.lo...
Python3
2021-10-17
3
530
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页