当前位置:网站首页>Max matrix and JS
Max matrix and JS
2022-07-25 03:57:00 【Big chicken legs are best】
Given a two-dimensional integer matrix , To select a sub matrix from this matrix , Make the sum of all the numbers in this submatrix as large as possible , We call this submatrix sum maximum submatrix , The selection principle of submatrix is a mutually continuous rectangular region in the original matrix .
Input description :
The first line of input contains 2 It's an integer n, m(1 <= n, m <= 10), It means a n That's ok m Columns of the matrix , There is n That's ok , Each row has m It's an integer , In the same line , Every time 2 There is... Between the two numbers 1 A space , There is no space after the last number , All the numbers are in [-1000, 1000] Between .
Output description :
Output one number per line , Represents all numbers and in the selected and largest submatrix .
Example 1
Input
3 4
-3 5 -1 5
2 4 -2 4
-1 3 -1 3
Output
20
explain
One 3*4 In the matrix of , Back 3 The sum of the submatrix of the column is equal to 20, And the biggest .
let n = Number(readline());
let m = Number(readline());
let ints = [];
for(let i=0;i<n;i++){
let input = readline().split(",").map(i=>parseInt(i));
let hang = [];
for(let j=0;j<m;j++){
hang[j] = input[j];
}
ints[i] = hang;
}
let max = 0;
for(let s边栏推荐
- Analysis of DNS domain name resolution process
- Localization distillation for dense object detection cvpr2022
- 应急响应全栈
- CVPR 2022 | content aware text logo image generation method
- Day 9 (capture traffic and routing strategy)
- 226. Flip binary tree DFS method
- Network construction and application in 2020 -- the answer of samba in Guosai
- C language_ Structure introduction
- Advantages and disadvantages of zero trust security
- Many local and municipal supervision departments carried out cold drink sampling inspection, and Zhong Xue's high-quality products were all qualified
猜你喜欢

Tiktok live broadcast brings goods to help the industry go to sea, and Fastdata observation industry boutique salon helps the ecological development

292. Nim game

Force button brushing question 61. rotating linked list

C language_ Defining structures and using variables

Machine learning notes - building a recommendation system (4) matrix decomposition for collaborative filtering

Traditional architecture of enterprise digital transformation to medium platform micro service architecture

Force deduction brush question 14. Longest common prefix

ECCV 2022 | rethinking image blending for data enhancement in vision transformers

Acwing 870. approximate number

Installation and tutorial of MATLAB curling simulation game
随机推荐
CVPR 2020 | social stgcnn: pedestrian trajectory prediction based on graph convolution
LeetCode. 302 weekly games___ 03_ 6121. Query the number smaller than k after cutting the number____ sort
Niuke interview high frequency list (group 1) difficulty: simple & medium
Deep learning method of building a model from zero
Memory leak due to improper handling of custom view
Original | ueditor1.4.3-asmx bypasses WAF
word怎么取消退出修订模式
[template engine] microservice Learning Notes 6: freemaker
[understanding of opportunity-47]: Guiguzi - Chapter 11 - decision makers, moderation, and rational distribution of interests
MIM command
How should enterprise users choose aiops or APM?
Localization distillation for dense object detection cvpr2022
场景之在线人数或者粉丝查询实现
基于SSM实现后勤报修系统
2022-07-19 study notes of group 5 self-cultivation class (every day)
[Flink] transform operator flatmap
P100 MSSQL database penetration test of secondary vocational network security skills competition
Moveit2 - 6. Planning scene monitor
Why does the legend of superstar (Jay Chou) not constitute pyramid selling? What is the difference between distribution and pyramid selling?
Fifth day of force deduction