problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
leetcode::solving_questions_with_brainpower::Solution类 参考

#include <leetcode.h>

静态 Public 成员函数

static long long mostPoints (vector< vector< int > > &questions)
 

详细描述

在文件 leetcode.h494 行定义.

成员函数说明

◆ mostPoints()

long long leetcode::solving_questions_with_brainpower::Solution::mostPoints ( vector< vector< int > > &  questions)
static

在文件 leetcode.cpp1086 行定义.

1086 {
1087 vector<long long> f(questions.size() + 1);
1088 for(int i = questions.size() - 1; i >= 0; --i) {
1089 auto &q = questions[i];
1090 const int j = i + q[1] + 1;
1091 f[i] = max(f[i + 1], q[0] + (j < questions.size() ? f[j] : 0));
1092 }
1093 return f[0];
1094 }

该类的文档由以下文件生成: