网站首页 站内搜索

搜索结果

查询Tags标签: le,共有 367条记录
  • 毛营 2022 部分题解

    游记鸽了 Day1 F 转化后的题意:要做物品大小为 \(10^9\),价值为 \(1\sim 4\) 的背包。\(10^5\) 个物品。 赛时的想法:设 \(f_i\) 为得到价值为 \(i\) 的最小代价,转移是个背包。 以前见过一个结论,\(1,2,3,4\) 的背包 \(f_{r},f_{r+12},f_{r+24}..\) 是个凸壳,证明的…

    2022/2/3 23:49:19 人评论 次浏览
  • 《初等数论》:高斯函数、n的阶乘的标准分解式

    文章目录 高斯函数定义定理例题 n的阶乘(n!)的标准分解式引理定理例题 End高斯函数 定义设x\,x\,x为任意实数,把不超过x\,x\,x的最大整数记作[x]\,[\,x\,]\,[x],称为高斯函数(也称取整函数)。大多数时候也常把[x]\,[\,x\,]\,[x]称为x\,x\,x的整数部分,把x−[x]\,x-[\…

    2022/1/26 23:35:06 人评论 次浏览
  • 算法分析-快速排序

    对于QuickSort,证明第一次分隔阶段(在指针交叉之前)用的平均交换次数是: N−26\frac{N-2}{6}6N−2​ 前提: 待排序数组为 NNN 个顺序随机且元素互异的数组;使用最后一个元素作为分隔元(partitioning element);数组索引为到 111 到 NNN 假设: 分隔元是 NNN 个数中…

    2022/1/8 12:03:55 人评论 次浏览
  • 算法分析-快速排序

    对于QuickSort,证明第一次分隔阶段(在指针交叉之前)用的平均交换次数是: N−26\frac{N-2}{6}6N−2​ 前提: 待排序数组为 NNN 个顺序随机且元素互异的数组;使用最后一个元素作为分隔元(partitioning element);数组索引为到 111 到 NNN 假设: 分隔元是 NNN 个数中…

    2022/1/8 12:03:55 人评论 次浏览
  • 557. Reverse Words in a String III

    Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Example 1: Input: s = "Lets take LeetCode contest" Output: "steL ekat edoCteeL tsetnoc" Exam…

    2022/1/7 6:33:28 人评论 次浏览
  • 557. Reverse Words in a String III

    Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Example 1: Input: s = "Lets take LeetCode contest" Output: "steL ekat edoCteeL tsetnoc" Exam…

    2022/1/7 6:33:28 人评论 次浏览
  • 283. Move Zeroes

    Given an integer array nums, move all 0s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0]…

    2022/1/7 6:03:40 人评论 次浏览
  • 283. Move Zeroes

    Given an integer array nums, move all 0s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0]…

    2022/1/7 6:03:40 人评论 次浏览
  • 167. Two Sum II - Input Array Is Sorted

    Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < inde…

    2022/1/7 6:03:39 人评论 次浏览
  • 167. Two Sum II - Input Array Is Sorted

    Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < inde…

    2022/1/7 6:03:39 人评论 次浏览
  • 344. Reverse String

    Given an integer array nums, move all 0s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0]…

    2022/1/7 6:03:33 人评论 次浏览
  • 344. Reverse String

    Given an integer array nums, move all 0s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0]…

    2022/1/7 6:03:33 人评论 次浏览
  • 977. Squares of a Sorted Array

    Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: Input: nums = [-4,-1,0,3,10] Output: [0,1,9,16,100] Explanation: After squaring, the array becomes [16…

    2022/1/6 23:33:34 人评论 次浏览
  • 977. Squares of a Sorted Array

    Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: Input: nums = [-4,-1,0,3,10] Output: [0,1,9,16,100] Explanation: After squaring, the array becomes [16…

    2022/1/6 23:33:34 人评论 次浏览
  • 贪心牛奶之部分背包问题

    题目来源:洛谷 题目描述阿里巴巴走进了装满宝藏的藏宝洞。藏宝洞里面有 N(N \le 100)N(N≤100) 堆金币,第 ii 堆金币的总重量和总价值分别是 m_i,v_i(1\le m_i,v_i \le 100)mi​,vi​(1≤mi​,vi​≤100)。阿里巴巴有一个承重量为 T(T \le 1000)T(T≤1000) 的背包,但并…

    2022/1/2 23:38:55 人评论 次浏览
扫一扫关注最新编程教程