随笔分类 -  一些好题

在敲代码做题时候遇到的一些令人称奇的好题
摘要:Cut the Sequence P10977 Cut the Sequence 前言 单调队列优化 dp 的好题,思维难度大细节多。因为觉得自己看不懂其他题解,在看完 y 总的讲解后豁然开朗,所以写这篇题解来巩固一下。包括完整的细节分析和思考过程,或许很多大佬都不需要 qwq。叠甲完毕,下面开始正 阅读全文
posted @ 2024-11-19 20:14 zhouruoheng 阅读(61) 评论(0) 推荐(1) 编辑
摘要:[SCOI2010] 股票交易 P2569 [SCOI2010] 股票交易 单调队列优化 dp 的经典问题。 分析 dp 加单调队列优化。 首先,不难想到是动态规划,看数据范围,可以支持 O(n2) 的算法。 第一维肯定是天数,但是显然不够,所以第二维可以是手中的股票数。设 \(f_{i, 阅读全文
posted @ 2024-11-19 09:53 zhouruoheng 阅读(17) 评论(0) 推荐(1) 编辑
摘要:#include <bits/stdc++.h> using namespace std; const int N=2e5+5,inf=0x7f7f7f7f; int n; struct Point { double x,y; }a[N],t[N]; bool cmp1(Point A,Point 阅读全文
posted @ 2024-09-28 12:41 zhouruoheng 阅读(9) 评论(0) 推荐(0) 编辑
摘要:[HAOI2008] 硬币购物 题目描述 共有 4 种硬币。面值分别为 c1,c2,c3,c4。 某人去商店买东西,去了 n 次,对于每次购买,他带了 dii 种硬币,想购买 s 的价值的东西。请问每次有多少种付款方法。 输入格式 输入 阅读全文
posted @ 2024-07-24 21:14 zhouruoheng 阅读(21) 评论(0) 推荐(1) 编辑
摘要:[USACO08JAN] Telephone Lines S 题目描述 Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he 阅读全文
posted @ 2024-06-07 12:49 zhouruoheng 阅读(14) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示