• HOJ 2713 Matrix1


    Matrix1

    My Tags   (Edit)
      Source : Classical Problem
      Time limit : 5 sec   Memory limit : 64 M

    Submitted : 424, Accepted : 129

    Lilu0355 is a thoughtful boy and always plays a classical mathematic game.The game plays like that, there is a n * m matrix, each grid of this matrix is filled with a non-negative number. You should remove some numbers from the matrix and make sure that any two numbers removed are not adjacent in the matrix. What is the biggest sum of those removed numbers? Lilu can always find the answer, can you?

    Input

    The first line is a integer T indicating the number of test cases.T cases fllows. Each case includs two integers n, m(m ≤ 50,n ≤ 50) and n * m non-negative integers, which is not more than 40000.

    Output

    For each test case, output the biggest sum.

    Sample Input

    1
    3 2
    180 25
    210 45
    220 100
    

    Sample Output

    445
    
  • 相关阅读:
    2020学习 04 python 爬取某政府网站信件
    2020学习03
    2020学习02
    阅读笔记--《一线架构师实践指南》--Pre-architecture阶段
    重构“信息领域热词分析”,实现六种质量属性战术
    pycharm错误:Error updating package list: connect timed out解决
    python连接mysql数据库——编码问题
    阅读笔记--《大型网站技术架构》—02架构
    python查询MySQL数据库的表以及所有字段
    python连接mysql数据库——版本问题
  • 原文地址:https://www.cnblogs.com/neighthorn/p/6159817.html
Copyright © 2020-2023  润新知