#include <leetcode.h>
|
static long long | mostPoints (vector< vector< int > > &questions) |
|
◆ mostPoints()
long long leetcode::solving_questions_with_brainpower::Solution::mostPoints |
( |
vector< vector< int > > & | questions | ) |
|
|
static |
在文件 leetcode.cpp 第 1086 行定义.
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 }
该类的文档由以下文件生成: