牛客err
牛客err
全部文章
分类
题解(4)
归档
标签
去牛客网
登录
/
注册
牛客err的博客
TA的专栏
20篇文章
0人订阅
数据结构练习
20篇文章
132人学习
全部文章
(共162篇)
题解 | #判断链表中是否有环#
来自专栏
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} ...
2024-08-20
1
89
题解 | #合并k个已排序的链表#
来自专栏
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: ...
2024-08-20
1
114
题解 | #合并两个排序的链表#
来自专栏
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <cstdlib> class ...
2024-08-19
1
97
题解 | #链表内指定区间反转#
来自专栏
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <endian.h> #i...
2024-08-19
1
82
题解 | #反转链表#
来自专栏
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: /*...
2024-08-19
1
98
题解 | #字符串合并处理#
str1, str2 = input().split() str3 = list(str1+str2) str3[::2] = sorted(str3[::2]) str3[1::2] = sorted(str3[1::2]) res = [] for i in str3: if i ...
2024-08-18
1
84
题解 | #密码强度等级#
def func(str1): if len(str1) <=4: return 5 elif 5<=len(str1)<=7: return 10 else: return 25 def func2...
2024-08-18
1
97
题解 | #矩阵乘法#
m = int(input()) # 第一个矩阵的行数 n = int(input()) # 第一个矩阵的列数和第二个矩阵的行数 o = int(input()) # 第二个矩阵的列数 arr1 = [] arr2 = [] for i in range(m): arr1.append(...
2024-08-18
1
88
题解 | #参数解析#
s = input() s = s.replace(' ','\n') e = '' flag = False # 核心思想是先遍历一遍,用一个bool当做开关,把字符串参数里的空格,换成分割符以外的 for i in s: if i == '"': flag...
2024-08-18
1
95
题解 | #合法IP#
try: # 就通过显示的用例一点一点加条件 res = 'YES' stri = input().split('.') for i in stri: if i[0] == "0" and len(i)>1: ...
2024-08-18
1
92
首页
上一页
4
5
6
7
8
9
10
11
12
13
下一页
末页