区间最小数乘区间和的最大值
题解
讨论
查看他人的提交
题号:NC235216
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
给定一个长度为 n 的正整数数组请你选出一个区间,使得该区间是所有区间中经过下述计算方法得到的值。
计算方法:区间最小值
区间和
数据范围:
,区间中所有元素都满足
示例1
输入
复制
[1,2,3,4,5]
[1,2,3,4,5]
返回值
复制
36
36
说明
示例2
输入
复制
[1,1,1,1,1]
[1,1,1,1,1]
返回值
复制
5
5
说明
区间最小数乘区间和的最大值
返回全部题目
列表加载中...
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型ArrayList * @return int整型 */ public int mintimessum (ArrayList
a) { // write code here } }
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型vector * @return int整型 */ int mintimessum(vector
& a) { // write code here } };
#coding:utf-8 # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param a int整型一维数组 # @return int整型 # class Solution: def mintimessum(self , a ): # write code here
using System; using System.Collections.Generic; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ public int mintimessum (List
a) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ function mintimessum( a ) { // write code here } module.exports = { mintimessum : mintimessum };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param a int整型一维数组 # @return int整型 # class Solution: def mintimessum(self , a: List[int]) -> int: # write code here
package main import "fmt" /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ func mintimessum( a []int ) int { // write code here }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @param aLen int a数组长度 * @return int整型 */ int mintimessum(int* a, int aLen ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param a int整型一维数组 # @return int整型 # class Solution def mintimessum(a) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ def mintimessum(a: Array[Int]): Int = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ fun mintimessum(a: IntArray): Int { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ public int mintimessum (int[] a) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ export function mintimessum(a: number[]): number { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ func mintimessum ( _ a: [Int]) -> Int { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param a int整型一维数组 * @return int整型 */ pub fn mintimessum(&self, a: Vec
) -> i32 { // write code here } }
[1,2,3,4,5]
36
[1,1,1,1,1]
5