人生苦短,但求成长
人生苦短,但求成长
全部文章
分类
题解(166)
归档
标签
去牛客网
登录
/
注册
人生苦短,但求成长的博客
全部文章
(共150篇)
题解 | #记票统计#一次循环就解决了吧
while True: try: n = int(input()) name_list = input().split() m = int(input()) vote_list = input().split() ...
Python3
2022-02-23
82
1915
题解 | #数组分组#递归YYDS
def fun(sum3, sum5, other): if sum3 == sum5 and len(other) == 0: return True elif len(other) == 0: return False else: ...
Python3
2022-02-23
5
461
题解 | #在字符串中找出连续最长的数字串#
while True: try: sub_str = [] max_len = 0 str_input = input() for i in range(len(str_input)): for...
Python3
2022-02-22
3
516
题解 | #走方格的方案数#递归YYDS
def methods(n, m): if n == 0 or m == 0: return 1 if n == 1 and m == 1: return 2 if (n == 2 and m == 1) or (n == 1 and m =...
Python3
2022-02-22
6
700
题解 | #合法IP#
while True: try: ip_str = input().split('.') if len(ip_str) != 4: print('NO') else: for each in ip_str: if len...
Python3
2022-02-22
3
448
题解 | #24点运算#主要还是怎么计算24点
import itertools def fun(a, b, c, d): card_dict = { '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, ...
Python3
2022-02-22
9
1274
题解 | #扑克牌大小#打牌还是不难
while True: try: card_dict = { '1': 1, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, ...
Python3
2022-02-21
1
432
题解 | #求最大连续bit数#速度有点慢
while True: try: n = int(input()) bin_str = bin(n) max_len = 0 for i in range(len(bin_str)): if bin_str[i] != '1': ...
Python3
2022-02-21
1
392
题解 | #最长回文子串#双指针
def fun(str_input): max_len = 0 for i in range(len(str_input)): for j in range(len(str_input) - 1, i - 1, -1): if str_input[i: j + 1][::-1...
Python3
2022-02-18
5
939
题解 | #统计大写字母个数#简单粗暴
while True: try: str_input = input() count = 0 for c in str_input: if ord(c) >= 65 and ord(c) <= 90: count += 1 ...
Python3
2022-02-18
1
295
首页
上一页
6
7
8
9
10
11
12
13
14
15
下一页
末页