天上掉下来SCI
天上掉下来SCI
全部文章
分类
题解(29)
归档
标签
去牛客网
登录
/
注册
天上掉下来SCI的博客
全部文章
(共41篇)
题解 | #分糖果问题#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # pick candy # @param arr int整型一维数组 the array # @return int整型 # class Solution: def candy(self, arr: List...
2023-05-09
0
246
题解 | #最长公共子序列(一)#
import sys m,n = map(int,input().split()) str1 = input() str2 = input() dp = [[0 for _ in range(n+1)] for _ in range(m+1)] for i in range(1,m+1):...
2023-05-05
1
269
题解 | #连续子数组最大和#
import sys n = list(map(int,input().split()))[0] arr = list(map(int,input().split())) dp = [] for i in range(n): if i ==0: dp.append(arr...
2023-05-04
0
262
题解 | #N皇后问题#
from math import fabs # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param n int整型 the n # @return int整型 # class Solution: def Nqueen(self , n: ...
2023-04-27
0
327
题解 | #kotori和素因子#
import sys n = list(map(int,input().split()))[0] arr = list(map(int,input().split())) dp = [[] for _ in range(n)] sum_list = [] count = [] a0 = [] s...
2023-04-26
1
443
题解 | #最小生成树#
from math import cos # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 返回最小的花费代价使得这n户人家连接起来 # @param n int整型 n户人家的村庄 # @param m int整型 m条路 # @param cost int...
2023-04-25
0
317
题解 | #走迷宫#
from math import inf from collections import deque import sys n,m = map(int,input().split()) #网格大小 xs,ys,xt,yt = map(int,input().split()) xs,ys,xt...
2023-04-24
0
294
题解 | #【模板】拓扑排序#
from collections import deque n,m = map(int,input().split()) root = [0]*n #顶点矩阵,存储能够到达0~n-1的点 d = [[] for _ in range(n)] #存储0~1能够能够到达哪些点 route ...
2023-04-20
0
285
题解 | #活动安排#
from math import inf import sys from collections import deque n = list(map(int, input().split()))[0] # 活动数 arr = [] flag = [] for _ in range(n): ...
2023-04-18
0
259
题解 | #最长上升子序列(一)#
import sys from collections import deque n = list(map(int, input().split()))[0] arr = list(map(int, input().split())) dp = [[] for _ in range(n)] dp[...
2023-04-17
0
296
首页
上一页
1
2
3
4
5
下一页
末页