Query failed with error code 96 and error message 'Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smal
题目在这里 题意: 加边是所有点连通,没有重边和自环,问最小代价 加边规则:两点权值奇偶性相同代价为a,否则为b − 100 ≤ a , b ≤ 100 -100\leq a,b \leq100 −100≤a,b≤100 分析: 这题就是一个分类讨论,先读进来统计奇数点和偶数点 记 n a na na为奇偶性相同的点的连边, n b nb nb为奇偶性不同的点的连边, j i ji ji为奇
一、问题描述: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST's. 1 3 3 2
题目: A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you aregiven the locations and height of all the buildi
343. 整数拆分 动归 递归拆 class Solution:def integerBreak(self, n: int) -> int:dp=[0]*(n+1)dp[2]=1for i in range(3,n+1):for j in range(1,i//2+1):dp[i]=max(dp[i],(i-j)*j,dp[i-j]*j)return dp[n] 公式:全拆3,剩1个4
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 分析: 将一个数字转化为罗马字符串表示。 大数左边加上小数就是把大数减去这个小数."M","CM","D","CD","C","XC","L","XL","X","I