当前位置:网站首页>2022 Henan Mengxin League Game (5): University of Information Engineering F - Split Turf
2022 Henan Mengxin League Game (5): University of Information Engineering F - Split Turf
2022-08-10 06:34:00 【WA_Automata】
F - split lawn
First you can use the interval d p dp dp 的方式,对于 d p [ i ] [ j ] dp[i][j] dp[i][j] 的求解,我们只要以 i i i, j j j 为底边,枚举顶点 k ( i < k < j ) k(i<k<j) k(i<k<j) ,Divide the triangle ( i , j , k ) (i,j,k) (i,j,k) ,Then we divide the required value into d p [ i ] [ k ] + d p [ k ] [ j ] + dp[i][k]+dp[k][j]+ dp[i][k]+dp[k][j]+ 三角形 ( i , j , k ) (i,j,k) (i,j,k) 的花费,Just find the value that costs the least.
之后可以发现,All triangles have a vertex for 1 1 1 is obviously the optimal solution,Derive the formula to get the answer
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
signed main()
{
int n;cin>>n;
LL res=0;
for(int i=3;i<=n;i++)
res+=i*(i-1);
cout<<res;
return 0;
}
边栏推荐
- MySQL笔记
- OpenGL学习笔记(LearnOpenGL)-第六部分 变换
- [Network Security] Practice AWVS Range to reproduce CSRF vulnerability
- 2022河南萌新联赛第(五)场:信息工程大学 K - 矩阵生成
- UnityShader入门精要-透明效果
- ES13 - ES2022 - 第 123 届 ECMA 大会批准了 ECMAScript 2022 语言规范
- 2022 Henan Mengxin League Game (5): University of Information Engineering K - Matrix Generation
- UnityShader入门精要-unity shader基础
- 强化学习_03_表格方法实践(CartPole-v0 And MontoCarlo)
- Qt绘制椭圆曲线的角度问题(离心角和旋转角)
猜你喜欢
随机推荐
JS中初始化对象为null和空对象的区别
驱动的参数传入:module_param,module_param_array,module_param_cb
直接跳转与间接跳转
Unity object pool implementation
ES13 - ES2022 - 第 123 届 ECMA 大会批准了 ECMAScript 2022 语言规范
第12章 数据库其它调优策略【2.索引及调优篇】【MySQL高级】
关于Qt高频率信号槽合并的误解和方案
elf文件与链接脚本
Tencent Cloud Song Xiang: Kubernetes cluster utilization improvement practice
语法基础(判断语句)
Unity2D动画生成操作(简单)
NetKeeper(创翼)开WIFI方法——2018.5
Two-dimensional cartoon rendering of strokes
unityFps射击
Unity3d famous project-Dark Tree translation
指纹浏览器在使用易路代理时常见的问题及解决办法
深入理解数组
Unity扩展编辑器EditorWindow 小玩意(一)
【8月9日活动预告】Prometheus峰会
一种奇怪的函数声明写法