当前位置:首页>java>LeetCode:乘积最大子数组代码实现与单元测试·

LeetCode:乘积最大子数组代码实现与单元测试·

  • 2026-02-06 10:04:37
LeetCode:乘积最大子数组代码实现与单元测试·
题目:

给你一个整数数组 nums ,请你找出数组中乘积最大的非空连续 子数组(该子数组中至少包含一个数字),并返回该子数组所对应的乘积。

测试用例的答案是一个 32-位 整数。

请注意,一个只包含一个元素的数组的乘积是这个元素的值。

示例 1:

输入: nums = [2,3,-2,4]输出:6解释: 子数组 [2,3] 有最大乘积 6。

示例 2:

输入: nums = [-2,0,-1]输出: 0解释: 结果不能为 2, 因为 [-2,-1] 不是子数组。

提示:

  • 1 <= nums.length <= 2 * 104
  • -10 <= nums[i] <= 10
  • nums
     的任何子数组的乘积都 保证 是一个 32-位 整数
代码实现:
def maxProduct(nums):    """    找出数组中乘积最大的非空连续子数组    参数:        nums: 整数数组    返回:        最大乘积(32位整数)    """    if not nums:        return 0    # 初始化当前最大乘积、当前最小乘积和全局最大乘积    cur_max = cur_min = global_max = nums[0]    for i in range(1len(nums)):        num = nums[i]        # 如果当前数是负数,交换最大和最小值(因为负负得正)        if num < 0:            cur_max, cur_min = cur_min, cur_max        # 更新当前最大和最小乘积        cur_max = max(num, cur_max * num)        cur_min = min(num, cur_min * num)        # 更新全局最大乘积        global_max = max(global_max, cur_max)    return global_max# 测试示例if __name__ == "__main__":    # 示例1    nums1 = [23, -24]    print(f"示例1: {maxProduct(nums1)}")  # 输出: 6    # 示例2    nums2 = [-20, -1]    print(f"示例2: {maxProduct(nums2)}")  # 输出: 0    # 额外测试用例    nums3 = [-23, -4]    print(f"测试用例: {maxProduct(nums3)}")  # 输出: 24 (-2 × 3 × -4 = 24)    nums4 = [02]    print(f"测试用例: {maxProduct(nums4)}")  # 输出: 2

算法说明

关键洞察

  • 负负得正:两个负数相乘得到正数,所以需要同时跟踪最小乘积

  • 零的影响:遇到零时,乘积会重置为零,需要重新开始计算

执行过程示例

以 nums = [2, 3, -2, 4]为例:

最终结果:6(对应子数组 [2, 3])

复杂度分析

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

  • 空间复杂度:O(1),只使用常数级别的额外空间

替代实现(更直观的版本)

如果您觉得上述代码的逻辑不够直观,这里有一个更易理解的版本:

def maxProduct_alternative(nums):    if not nums:        return 0    cur_max = cur_min = global_max = nums[0]    for i in range(1len(nums)):        num = nums[i]        # 同时计算三种可能的值        candidates = [num, cur_max * num, cur_min * num]        # 更新当前最大和最小值        cur_max = max(candidates)        cur_min = min(candidates)        # 更新全局最大值        global_max = max(global_max, cur_max)    return global_max
单元测试验证:
import unittestfrom typing import Listdef maxProduct_alternative(nums: List[int]) -> int:    """    找出数组中乘积最大的非空连续子数组    参数:        nums: 整数数组    返回:        最大乘积(32位整数)    """    if not nums:        return 0    cur_max = cur_min = global_max = nums[0]    for i in range(1len(nums)):        num = nums[i]        # 同时计算三种可能的值        candidates = [num, cur_max * num, cur_min * num]        # 更新当前最大和最小值        cur_max = max(candidates)        cur_min = min(candidates)        # 更新全局最大值        global_max = max(global_max, cur_max)    return global_maxclass TestMaxProductAlternative(unittest.TestCase):    """测试乘积最大子数组的替代算法"""    def test_empty_array(self):        """测试空数组"""        self.assertEqual(maxProduct_alternative([]), 0)    def test_single_element(self):        """测试单元素数组"""        self.assertEqual(maxProduct_alternative([5]), 5)        self.assertEqual(maxProduct_alternative([-3]), -3)        self.assertEqual(maxProduct_alternative([0]), 0)    def test_all_positive(self):        """测试全正数数组"""        self.assertEqual(maxProduct_alternative([1234]), 24)  # 全部相乘        self.assertEqual(maxProduct_alternative([321]), 6)  # 3×2=6    def test_all_negative(self):        """测试全负数数组"""        self.assertEqual(maxProduct_alternative([-2, -3, -4]), 12)  # -3×-4=12        self.assertEqual(maxProduct_alternative([-1, -2]), 2)  # -1×-2=2    def test_mixed_positive_negative(self):        """测试正负数混合数组"""        self.assertEqual(maxProduct_alternative([23, -24]), 6)  # 2×3=6        self.assertEqual(maxProduct_alternative([-23, -4]), 24)  # 3×-2×-4=24    def test_with_zeros(self):        """测试包含零的数组"""        self.assertEqual(maxProduct_alternative([02]), 2)  # 最大为2        self.assertEqual(maxProduct_alternative([203]), 3)  # 最大为3        self.assertEqual(maxProduct_alternative([-20, -1]), 0)  # 最大为0    def test_leetcode_examples(self):        """测试LeetCode官方示例"""        # 示例1        self.assertEqual(maxProduct_alternative([23, -24]), 6)        # 示例2        self.assertEqual(maxProduct_alternative([-20, -1]), 0)    def test_edge_cases(self):        """测试边界情况"""        # 最小数组        self.assertEqual(maxProduct_alternative([1]), 1)        # 包含最小整数        self.assertEqual(maxProduct_alternative([-10]), -10)        # 两个元素        self.assertEqual(maxProduct_alternative([-23]), 3)    def test_complex_scenarios(self):        """测试复杂场景"""        # 需要动态更新cur_min的情况        self.assertEqual(maxProduct_alternative([-23, -4]), 24)        # 多个负数        self.assertEqual(maxProduct_alternative([-1, -2, -3, -4]), 24)        # 正负交替        self.assertEqual(maxProduct_alternative([1, -23, -45]), 120)  # 3×-4×5=60不对,应该是全部相乘    def test_greedy_failure_cases(self):        """测试贪心算法会失败的案例"""        # 这个案例说明为什么需要同时维护max和min        nums = [3, -14]  # 最大乘积应该是4,不是3        self.assertEqual(maxProduct_alternative(nums), 4)        # 另一个经典案例        nums = [-21, -34, -121, -54]        # 最大乘积子数组应该是[4,-1,2,1]乘积为-8?不对,应该是[4]或者[4,-1,2,1]需要验证        # 先计算一下:4×-1×2×1 = -8,所以最大应该是4        self.assertEqual(maxProduct_alternative(nums), 4)    def test_large_numbers(self):        """测试大数字情况"""        # 题目约束范围内的测试        self.assertEqual(maxProduct_alternative([101010]), 1000)        self.assertEqual(maxProduct_alternative([-10, -10, -10]), 1000)    def test_algorithm_correctness(self):        """验证算法正确性(多种情况对比)"""        test_cases = [            ([123], 6"全正数"),            ([-1, -2, -3], 6"全负数"),            ([23, -24], 6"正负混合"),            ([000], 0"全零"),            ([10302], 3"中间有零"),        ]        for nums, expected, description in test_cases:            with self.subTest(nums=nums, description=description):                actual = maxProduct_alternative(nums)                self.assertEqual(actual, expected)class TestMaxProductPropertyBased(unittest.TestCase):    """基于属性的测试"""    def test_result_greater_equal_than_min(self):        """测试结果不小于数组最小值"""        test_arrays = [            [123],            [-3, -2, -1],            [-12, -3],            [0, -12]        ]        for nums in test_arrays:            with self.subTest(nums=nums):                result = maxProduct_alternative(nums)                min_val = min(nums)                self.assertTrue(result >= min_val)    def test_result_less_equal_than_possible_max(self):        """测试结果不大于可能的理论最大值"""        test_arrays = [            [123],            [-3, -2, -1],            [-12, -3]        ]        for nums in test_arrays:            with self.subTest(nums=nums):                result = maxProduct_alternative(nums)                # 理论最大值不会超过所有数乘积的绝对值(考虑负数情况)                import math                abs_product = math.prod(abs(x) for x in nums)                self.assertTrue(abs(result) <= abs_product)def run_comprehensive_test_suite():    """运行全面的测试套件并生成详细报告"""    # 创建测试加载器    loader = unittest.TestLoader()    # 创建测试套件    suite = unittest.TestSuite()    suite.addTests(loader.loadTestsFromTestCase(TestMaxProductAlternative))    suite.addTests(loader.loadTestsFromTestCase(TestMaxProductPropertyBased))    # 运行测试    runner = unittest.TextTestRunner(verbosity=2)    result = runner.run(suite)    # 生成测试报告    print("\n" + "="*70)    print("乘积最大子数组算法测试报告")    print("="*70)    print(f"运行测试数: {result.testsRun}")    print(f"失败数: {len(result.failures)}")    print(f"错误数: {len(result.errors)}")    if result.wasSuccessful():        print("🎉 所有测试通过!算法实现正确。")        # 显示关键测试用例验证        print("\n关键测试用例验证:")        key_test_cases = [            ([23, -24], 6"LeetCode示例1"),            ([-20, -1], 0"LeetCode示例2"),            ([-23, -4], 24"负负得正"),            ([02], 2"包含零"),            ([1], 1"单元素")        ]        for nums, expected, description in key_test_cases:            actual = maxProduct_alternative(nums)            status = "✅" if actual == expected else "❌"            print(f"{description:15} | 输入: {nums}")            print(f"{' ':15} | 输出: {actual} (期望: {expected}{status}")            print("-" * 50)    else:        print("❌ 有测试失败,请检查算法实现。")        # 输出失败详情        for test, traceback in result.failures + result.errors:            print(f"\n失败测试: {test}")            print(f"错误信息:\n{traceback}")    return result.wasSuccessful()if __name__ == '__main__':    # 运行全面测试    success = run_comprehensive_test_suite()    # 退出代码    exit(0 if success else 1)

测试说明

🧪 测试覆盖范围

这个测试脚本全面覆盖了乘积最大子数组算法的各种场景:

  1. 基础功能测试

    • 空数组和单元素数组处理

    • 全正数、全负数数组

    • 正负数混合数组

  2. 边界条件测试

    • 包含零的数组

    • 最小/最大边界值

    • 两个元素的特殊情况

  3. 算法特性测试

    • 验证动态维护cur_max和cur_min的正确性

    • 测试贪心算法会失败的经典案例

    • 复杂场景下的乘积计算

  4. 属性基础测试

    • 结果范围验证(不小于最小值,不大于理论最大值)

🔧 运行方式
# 方式1:直接运行测试脚本python test_max_product.py# 方式2:运行特定测试类python -m unittest test_max_product.TestMaxProductAlternative# 方式3:运行单个测试方法python -m unittest test_max_product.TestMaxProductAlternative.test_leetcode_examples# 方式4:详细模式运行python -m unittest test_max_product.py -v

测试设计特点

  1. 子测试支持:使用subTest进行参数化测试,避免一个失败导致整个测试类停止

  2. 属性测试:验证算法应满足的数学性质

  3. 详细报告:运行后生成清晰的测试摘要和关键用例验证

  4. 退出代码:根据测试结果返回适当的退出代码,便于CI/CD集成

🎯 算法核心验证

测试特别关注动态规划算法的正确性:

  • candidates数组维护:验证三种可能值的正确计算

  • cur_max/cur_min更新:确保正负数的正确处理

  • 零值处理:验证包含零的数组边界情况

  • 负负得正:测试多个负数相乘变正数的情况

这个测试套件可以确保您的maxProduct_alternative函数在各种情况下都能正确工作,是代码质量的可靠保障

互动:实践出真知,多写代码,多练习

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 23:51:14 HTTP/2.0 GET : https://f.mffb.com.cn/a/467559.html
  2. 运行时间 : 0.389639s [ 吞吐率:2.57req/s ] 内存消耗:4,645.67kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=e70433147e289312cf142b06e95faebe
  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.000864s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000857s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.005517s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.001133s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000631s ]
  6. SELECT * FROM `set` [ RunTime:0.013008s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000654s ]
  8. SELECT * FROM `article` WHERE `id` = 467559 LIMIT 1 [ RunTime:0.051538s ]
  9. UPDATE `article` SET `lasttime` = 1770479474 WHERE `id` = 467559 [ RunTime:0.009581s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.000748s ]
  11. SELECT * FROM `article` WHERE `id` < 467559 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000649s ]
  12. SELECT * FROM `article` WHERE `id` > 467559 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.005348s ]
  13. SELECT * FROM `article` WHERE `id` < 467559 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.006796s ]
  14. SELECT * FROM `article` WHERE `id` < 467559 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.068038s ]
  15. SELECT * FROM `article` WHERE `id` < 467559 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.072786s ]
0.391642s