GB279824
GB279824
全部文章
分类
归档
标签
去牛客网
登录
/
注册
GB279824的博客
全部文章
(共190篇)
题解 | 最小覆盖子串
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param S string字符串 # @param T string字符串 # @return string字符串 # class Solution: def minWindow(self...
2025-06-18
0
16
题解 | 最长回文子串
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param A string字符串 # @return int整型 # class Solution: def getLongestPalindrome(self , A: str) ->...
2025-06-18
0
18
题解 | 成绩排序
n = int(input().strip()) orders = int(input().strip()) values = [] for _ in range(n): name,score = input().strip().split() values.append((na...
2025-06-18
0
16
题解 | 查找兄弟单词
def is_anagram(s1,s2): return sorted(s1) == sorted(s2) def find_brother_words(words,x,k): brother_words = [] for word in words: ...
2025-06-18
0
14
题解 | 字符串排序
n = int(input().strip()) words = [input().strip() for _ in range(n)] sorted_word = sorted(words) for word in sorted_word: print(word)
2025-06-18
0
13
题解 | 合并表记录
n = int(input().strip()) # 使用字典存储每个索引对应的数值总和 index_sum = {} for _ in range(n): x,y = map(int,input().split(" ")) if x in index_sum...
2025-06-18
0
13
题解 | 跳台阶
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param number int整型 # @return int整型 # class Solution: def jumpFloor(self , number: int) -> int...
2025-06-17
0
26
题解 | 字符个数统计
s = input() ch = '' count = 0 for i in range(len(s)): if s[i] not in ch: ch = ch + s[i] for i in ch: if ord(i) >0 and ord(i)<127...
2025-06-17
0
18
题解 | 明明的随机数
if __name__ == "__main__": n = int(input()) nums = set() for _ in range(n): num = int(input().strip()) nums.add(...
2025-06-17
1
17
题解 | 两数之和
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param numbers int整型一维数组 # @param target int整型 # @return int整型一维数组 # class Solution: def twoSum(...
2025-06-17
0
18
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页