当前位置:首页>python>Python版_Leetcode_hot100系列(14)--贪心算法

Python版_Leetcode_hot100系列(14)--贪心算法

  • 2026-02-03 05:53:25
Python版_Leetcode_hot100系列(14)--贪心算法

121.买卖股票的最佳时机

🎭 题目小剧场

想象你在股市观察一支股票的价格波动,想找到买入和卖出的最佳时机。你不能回到过去,只能在价格走势中找到那个"低买高卖"的黄金组合,赚取最大利润!

💡 解题思路

一次遍历解法:

  1. 维护一个变量记录当前遇到的最小价格

  2. 遍历价格数组,计算当前价格与最小价格的差值

  3. 更新最大利润

  4. 更新最小价格

🐍 Python代码实现

class Solution:    def maxProfit(self, prices: List[int]) -> int:        """        一次遍历解法 - 时间复杂度O(n),空间复杂度O(1)        """        min_price = float('inf')  # 当前最小价格        max_profit = 0            # 最大利润        for price in prices:            # 更新最小价格            if price < min_price:                min_price = price            # 计算当前利润            current_profit = price - min_price            # 更新最大利润            if current_profit > max_profit:                max_profit = current_profit        return max_profit

📊 复杂度分析

  • 时间复杂度:O(n) - 只需要遍历一次价格数组

  • 空间复杂度:O(1) - 只使用常数额外空间

🌟 算法精髓

这个算法的巧妙之处在于"前瞻后顾"。在遍历每个价格时,我们既回顾了历史最低价,又展望了当前可能的利润,实现了动态的最优决策。

🎯 小白友好贴士

  • min_price = float('inf') 初始化为无穷大

  • max_profit = 0 初始化最大利润为0

  • if price < min_price 更新最小价格

  • current_profit = price - min_price 计算当前利润

  • if current_profit > max_profit 更新最大利润

🔍 算法执行过程示例

prices = [715364]初始:min_price = inf, max_profit = 01天:price = 7  min_price = min(inf, 7) = 7  current_profit = 7 - 7 = 0  max_profit = max(00) = 02天:price = 1  min_price = min(71) = 1  current_profit = 1 - 1 = 0  max_profit = max(00) = 03天:price = 5  min_price = min(15) = 1  current_profit = 5 - 1 = 4  max_profit = max(04) = 44天:price = 3  min_price = min(13) = 1  current_profit = 3 - 1 = 2  max_profit = max(42) = 45天:price = 6  min_price = min(16) = 1  current_profit = 6 - 1 = 5  max_profit = max(45) = 56天:price = 4  min_price = min(14) = 1  current_profit = 4 - 1 = 3  max_profit = max(53) = 5结束:return max_profit = 5 ✅

🎯 核心思想总结

  1. 历史最低:记录遍历过程中的最低价格

  2. 即时计算:在每个价格点计算可能的利润

  3. 动态更新:不断更新最大利润

  4. 一次遍历:高效的线性时间解决方案


55.跳跃游戏

🎭 题目小剧场

想象你在玩一个跳格子游戏,每个格子上写着你能跳的最远距离。你需要判断是否能从起点跳到终点。就像超级玛丽一样,每个蘑菇都能给你不同的跳跃力!

💡 解题思路

贪心解法(反向):

  1. 从终点开始,反向思考

  2. 维护一个"可到达"的位置

  3. 检查每个位置是否能跳到"可到达"位置

  4. 如果能,更新"可到达"位置为当前位置

  5. 最后检查起点是否"可到达"

🐍 Python代码实现

class Solution:    def canJump(self, nums: List[int]) -> bool:        """        贪心解法(反向) - 时间复杂度O(n),空间复杂度O(1)        """        if not nums:            return False        # 从终点开始,维护一个可到达的位置        reachable = len(nums) - 1        # 从倒数第二个位置开始向前遍历        for i in range(len(nums) - 2, -1, -1):            # 如果当前位置能跳到可到达位置            if i + nums[i] >= reachable:                reachable = i        # 检查起点是否可到达终点        return reachable == 0

📊 复杂度分析

  • 时间复杂度:O(n) - 只需要遍历一次数组

  • 空间复杂度:O(1) - 只使用常数额外空间

🌟 算法精髓

这个算法的巧妙之处在于"逆向思维"。我们不是从起点看能到哪里,而是从终点看能从哪里来,大大简化了问题。

🎯 小白友好贴士

  • reachable = len(nums) - 1 初始化可到达位置为终点

  • range(len(nums) - 2, -1, -1) 从倒数第二个位置向前遍历

  • i + nums[i] >= reachable 判断是否能跳到可到达位置

  • reachable = i 更新可到达位置

  • return reachable == 0 检查起点是否可到达

🔍 算法执行过程示例

示例1:nums = [23114]初始:reachable = 4 (终点)1步:i = 3, nums[3] = 1  检查:3 + 1 = 4 >= reachable = 4 ✓  更新:reachable = 32步:i = 2, nums[2] = 1  检查:2 + 1 = 3 >= reachable = 3 ✓  更新:reachable = 23步:i = 1, nums[1] = 3  检查:1 + 3 = 4 >= reachable = 2 ✓  更新:reachable = 14步:i = 0, nums[0] = 2  检查:0 + 2 = 2 >= reachable = 1 ✓  更新:reachable = 0  结束:reachable = 0 == 0 ✓ return True ✅示例2:nums = [32104]初始:reachable = 4 (终点)1步:i = 3, nums[3] = 0  检查:3 + 0 = 3 < reachable = 4 ✗  不更新:reachable = 42步:i = 2, nums[2] = 1  检查:2 + 1 = 3 < reachable = 4 ✗  不更新:reachable = 43步:i = 1, nums[1] = 2  检查:1 + 2 = 3 < reachable = 4 ✗  不更新:reachable = 44步:i = 0, nums[0] = 3  检查:0 + 3 = 3 < reachable = 4 ✗  不更新:reachable = 4结束:reachable = 4 != 0 ✗ return False ✅

🎯 核心思想总结

  1. 逆向思维:从终点向前思考

  2. 贪心策略:每次都寻找最远的可到达位置

  3. 动态更新:不断更新可到达的位置

  4. 最终判断:检查起点是否可到达终点


45.跳跃游戏  II

🎭 题目小剧场

想象你在玩一个跳格子游戏,每个格子上写着你能跳的最远距离。这次不仅要判断能否到达终点,还要找到最少的跳跃次数!就像规划旅行路线,想用最少的换乘次数到达目的地!

💡 解题思路

贪心解法(分层遍历):

  1. 维护当前层的最远位置和下一层的最远位置

  2. 遍历数组,在当前层内寻找下一层的最远位置

  3. 到达当前层边界时,跳跃次数加1,切换到下一层

  4. 继续直到到达终点

🐍 Python代码实现

class Solution:    def jump(self, nums: List[int]) -> int:        """        贪心解法(分层遍历) - 时间复杂度O(n),空间复杂度O(1)        """        if len(nums) <= 1:            return 0        jumps = 0           # 跳跃次数        current_end = 0     # 当前层的最远位置        farthest = 0        # 下一层的最远位置        # 注意:不需要遍历最后一个元素        for i in range(len(nums) - 1):            # 更新下一层的最远位置            farthest = max(farthest, i + nums[i])            # 到达当前层边界,需要跳跃            if i == current_end:                jumps += 1                current_end = farthest                # 如果已经能到达终点,提前结束                if current_end >= len(nums) - 1:                    break        return jumps

📊 复杂度分析

  • 时间复杂度:O(n) - 只需要遍历一次数组

  • 空间复杂度:O(1) - 只使用常数额外空间

🌟 算法精髓

这个算法的巧妙之处在于"分层思考"。我们将跳跃过程看作一层层的扩展,每次在当前层内找到最优的下一层起点,实现最少的跳跃次数。

🎯 小白友好贴士

  • jumps = 0 记录跳跃次数

  • current_end = 0 当前层的最远位置

  • farthest = 0 下一层的最远位置

  • farthest = max(farthest, i + nums[i]) 更新下一层最远位置

  • if i == current_end 到达当前层边界,需要跳跃

🔍 算法执行过程示例

示例1:nums = [23114]初始:jumps = 0, current_end = 0, farthest = 01步:i = 0, nums[0] = 2  farthest = max(00 + 2) = 2  i == current_end (0 == 0) ✓  jumps = 1, current_end = 22步:i = 1, nums[1] = 3  farthest = max(21 + 3) = 4  i != current_end (1 != 2) ✗3步:i = 2, nums[2] = 1  farthest = max(42 + 1) = 4  i == current_end (2 == 2) ✓  jumps = 2, current_end = 4  current_end >= len(nums) - 1 (4 >= 4) ✓ break结束:return jumps = 2 ✅示例2:nums = [23014]初始:jumps = 0, current_end = 0, farthest = 01步:i = 0, nums[0] = 2  farthest = max(00 + 2) = 2  i == current_end (0 == 0) ✓  jumps = 1, current_end = 22步:i = 1, nums[1] = 3  farthest = max(21 + 3) = 4  i != current_end (1 != 2) ✗3步:i = 2, nums[2] = 0  farthest = max(42 + 0) = 4  i == current_end (2 == 2) ✓  jumps = 2, current_end = 4  current_end >= len(nums) - 1 (4 >= 4) ✓ break结束:return jumps = 2 ✅

🎯 核心思想总结

  1. 分层遍历:将跳跃过程看作层层扩展

  2. 贪心选择:在当前层内寻找最优的下一层起点

  3. 边界判断:到达当前层边界时必须跳跃

  4. 提前终止:一旦能到达终点就立即结束


763.划分字母区间

🎭 题目小剧场

想象你在给一串字母分组,每个字母都有自己的"势力范围"(从第一次出现到最后一次出现)。你需要将这些势力范围合并,形成互不重叠的分组。就像给不同部门分配办公室,每个部门的所有员工都要在同一个办公室里!

💡 解题思路

贪心解法:

  1. 记录每个字母的最后出现位置

  2. 遍历字符串,维护当前区间的结束位置

  3. 遇到字母的最后位置超出当前区间,扩展区间

  4. 到达当前区间结束时,记录区间并开始新区间

🐍 Python代码实现

class Solution:    def partitionLabels(self, s: str) -> List[int]:        """        贪心解法 - 时间复杂度O(n),空间复杂度O(1)        """        # 记录每个字母的最后出现位置        last_pos = {}        for i, char in enumerate(s):            last_pos[char] = i        result = []        start = 0      # 当前区间的开始位置        end = 0        # 当前区间的结束位置        for i, char in enumerate(s):            # 扩展当前区间的结束位置            end = max(end, last_pos[char])            # 到达当前区间结束位置            if i == end:                result.append(end - start + 1)                start = i + 1        return result

📊 复杂度分析

  • 时间复杂度:O(n) - 遍历字符串两次

  • 空间复杂度:O(1) - 字母表大小固定,最多26个字母

🌟 算法精髓

这个算法的巧妙之处在于"区间合并"。我们先确定每个字母的"势力范围",然后贪心地合并重叠的范围,形成最大的不重叠区间。

🎯 小白友好贴士

  • last_pos = {} 记录每个字母的最后位置

  • last_pos[char] = i 更新字母的最后位置

  • end = max(end, last_pos[char]) 扩展当前区间

  • if i == end 到达区间结束位置

  • result.append(end - start + 1) 记录区间长度

🔍 算法执行过程示例

示例1:s = "ababcbacadefegdehijhklij"1步:记录每个字母的最后位置  a: 8, b: 5, c: 7, d: 14, e: 15, f: 11, g: 13, h: 19, i: 22, j: 23, k: 20, l: 212步:遍历字符串,划分区间初始:start = 0end = 0result = []  i=0char='a'end = max(08= 8  i=1char='b'end = max(85= 8  i=2char='a'end = max(88= 8  i=3char='b'end = max(85= 8  i=4char='c'end = max(87= 8  i=5char='b'end = max(85= 8  i=6char='a'end = max(88= 8  i=7char='c'end = max(87= 8  i=8char='a'end = max(88= 8  i == end (8 == 8) ✓  result.append(8 - 0 + 1= [9]start = 9  i=9char='d'end = max(914= 14  i=10char='e'end = max(1415= 15  i=11char='f'end = max(1511= 15  i=12char='e'end = max(1515= 15  i=13char='g'end = max(1513= 15  i=14char='d'end = max(1514= 15  i=15char='e'end = max(1515= 15  i == end (15 == 15) ✓  result.append(15 - 9 + 1= [97]start = 16  i=16char='h'end = max(1619= 19  i=17char='i'end = max(1922= 22  i=18char='j'end = max(2223= 23  i=19char='h'end = max(2319= 23  i=20char='k'end = max(2320= 23  i=21char='l'end = max(2321= 23  i=22char='i'end = max(2322= 23  i=23char='j'end = max(2323= 23  i == end (23 == 23) ✓  result.append(23 - 16 + 1= [978]start = 24结束:return [978] ✅

🎯 核心思想总结

  1. 势力范围:确定每个字母的出现范围

  2. 贪心合并:不断扩展当前区间直到无法再扩展

  3. 边界判断:到达区间边界时立即切割

  4. 最优解:形成尽可能大的不重叠区间

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-09 14:17:23 HTTP/2.0 GET : https://f.mffb.com.cn/a/462134.html
  2. 运行时间 : 0.123988s [ 吞吐率:8.07req/s ] 内存消耗:4,592.65kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=d4277f217488444e97b06b6aeb15d6ce
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000613s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000954s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.011615s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000392s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000612s ]
  6. SELECT * FROM `set` [ RunTime:0.002196s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000643s ]
  8. SELECT * FROM `article` WHERE `id` = 462134 LIMIT 1 [ RunTime:0.007953s ]
  9. UPDATE `article` SET `lasttime` = 1770617843 WHERE `id` = 462134 [ RunTime:0.008967s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000328s ]
  11. SELECT * FROM `article` WHERE `id` < 462134 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.004535s ]
  12. SELECT * FROM `article` WHERE `id` > 462134 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001443s ]
  13. SELECT * FROM `article` WHERE `id` < 462134 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.004847s ]
  14. SELECT * FROM `article` WHERE `id` < 462134 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.006745s ]
  15. SELECT * FROM `article` WHERE `id` < 462134 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001761s ]
0.125631s