首页 > TAG信息列表 > Marvolo

CF855B Marvolo Gaunt's Ring

洛谷题面 题目大意 给定 \(n,p,q,r\),并且给出 \(n\) 个数。 在这些数中找 \(i,j,k(1\le i\le j\le k\le n)\),求出 \(\max\{p\times a_i+q\times a_j+r\times a_k\}\)。 题目分析 一道小清新 \(\rm DP\) 题。 设 \(dp[idx][0]\) 表示前 \(idx\) 个数的 \(\max\{p\times a_i\}(1\le

B. Marvolo Gaunt's Ring 前缀后缀

B. Marvolo Gaunt's Ring 这种一般只有三个的都可以处理前缀和后缀,再枚举中间这个值。 这个和之前写过的C. Four Segments 前缀后缀 处理方式很像。 #include <cstdio>#include <cstring>#include <cstdlib>#include <algorithm>#include <queue>#include <vector>#include <i

Codeforces 855B:Marvolo Gaunt's Ring(枚举,前后缀)

B. Marvolo Gaunt's Ring Professor Dumbledore is helping Harry destroy the Horcruxes. He went to Gaunt Shack as he suspected a Horcrux to be present there. He saw Marvolo Gaunt's Ring and identified it as a Horcrux. Although he destroyed it,