manderous
manderous
全部文章
分类
归档
标签
去牛客网
登录
/
注册
manderous的博客
全部文章
(共9篇)
题解 | #素数伴侣#
import math def check_prime(num): for i in range(2, int(math.sqrt(num)+1)): if num%i == 0: return False return True def ...
2024-10-18
0
34
题解 | #龙与地下城游戏问题#
import sys lines = [] for line in sys.stdin: a = line.split() lines.append(a) m = int(lines[0][1]) n = int(lines[0][0]) DP = [[0 for _ in ra...
2024-10-11
0
51
题解 | #快速乘#
import sys lines = [] for line in sys.stdin: a = line.split() lines.append(a) for i in range(int(lines[0][0])): cur_line = lines[i+1] ...
2024-10-09
0
56
题解 | #汉诺塔问题#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param n int整型 # @return string字符串一维数组 # class Solution: def a_to_b(self, n, a_str, b_str):...
2024-09-23
0
65
题解 | #汉诺塔问题#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param n int整型 # @return string字符串一维数组 # class Solution: def mid_to_right(self, n): ...
2024-09-23
0
53
题解 | #二分查找-I#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param nums int整型一维数组 # @param target int整型 # @return int整型 # class Solution: def binary_search...
2024-09-23
0
48
题解 | #【模板】链表#
import sys class My_LinkedList: def __init__(self): self.linked_list = [] def insert_func(self, inserted_dot, insert_dot): ...
2024-09-20
0
55
题解 | #【模板】队列#
import sys class My_queue: def __init__(self): self.my_queue = [] def push(self, input): self.my_queue.append(input) ...
2024-09-19
0
67
题解 | #【模板】栈#
from os import error import sys class My_stack: def __init__(self): self.stack_list = [] def push(self, input): self.stack_l...
2024-09-19
0
72