4thirteen2one
4thirteen2one
全部文章
分类
题解(37)
归档
标签
去牛客网
登录
/
注册
4thirteen2one的博客
TA的专栏
1篇文章
0人订阅
我的刷题记录
1篇文章
353人学习
全部文章
(共29篇)
题解 | #HJ43 迷宫问题#
def walk(i, j, path): if (j+1 < n) and (maze[i][j+1] == 0) and ((i, j+1) not in path): # 向右可以走 且 没走过 walk(i, j+1, path + [(i, j+1)]) ...
图
Python3
2022-07-27
8
845
题解 | #BM45 滑动窗口的最大值#
class Solution: def maxInWindows(self, num: List[int], size: int) -> List[int]: # 0~size-1 [0,size] # n-size~n-1 [n-size,n] ...
Python3
2022-07-25
0
339
题解 | #HJ28 素数伴侣#
def check_prime(num): if (num > 1): for i in range(2, int(num**0.5)+1): if (num % i == 0): return False ...
Python3
2022-07-24
0
726
题解 | #HJ41 称砝码#
n = int(input()) m_list = [i for i in map(int, input().strip().split())] x_list = [i for i in map(int, input().strip().split())] status = [] for i i...
Python3
2022-07-23
0
849
题解 | #HJ25 数据分类处理#
while True: try: i_seq = input().split()[1:] r_seq = sorted(list(set(input().split()[1:])), key=lambda x: int(x)) result =...
Python3
2022-07-11
0
513
题解 | #NC37 合并区间#
# class Interval: # def __init__(self, a=0, b=0): # self.start = a # self.end = b # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # ...
Python3
2022-07-10
2
1323
题解 | #NC17 最长回文子串#
Python 版本 暴力遍历 class Solution: def getLongestPalindrome(self , A: str) -> int: for i in range(len(A), 0, -1): # 从大到小控制回文长度 ...
Python3
2022-07-07
1
741
题解 | #HJ84 统计大写字母个数#
C语言版本 #include <stdio.h> int main() { char s[251]; scanf("%[^\n]", s); int count = 0; for (int i = 0; i < strlen(s); i++) { ...
C
Python3
2022-06-19
0
532
题解 | #HJ94 记票统计#
while True: try: n = int(input()) candidates = input().split() m = int(input()) votes = input().split() ...
Python3
2022-06-19
0
386
题解 | #HJ81 字符串字符匹配#
C语言版本 #include <stdio.h> #include <stdbool.h> int main() { char S[201]; char T[201]; scanf("%s", S); scanf("%s", T); ...
C
Python3
2022-06-19
0
476
首页
上一页
1
2
3
下一页
末页