当前位置:网站首页>HDU - 3183 A Magic Lamp Segment Tree
HDU - 3183 A Magic Lamp Segment Tree
2022-08-09 07:03:00 【swust_fang】
Topic link
The meaning of the title: The number after deleting k values from the number string is the smallest, not counting the leading 0
Idea: In fact, it is the smallest lexicographical order, then we must determine the smallest value one by one, then for the i bit, in fact, find out whether the smallest number in the i+1~i+k bit is more than the current position.Small, if any, delete all the middle ones.So in fact, it is to find the minimum subscript of the minimum value of i+1~i+1+k on the right side of a certain i, and we can use the line segment tree to maintain it.Hahaha~ I asked the senior, the senior called me mentally retarded (hh
In fact, the line segment tree maintains a node, just reload it~
It's a pity that there are still n squares of solutions to the problem.
AC Code:
#include#include#include#include#include#include#include#include#include
边栏推荐
- SIGINT, SIGKILL, SIGTERM signal difference, summary of various signals
- ByteDance Interview Questions: Mirror Binary Tree 2020
- P7阿里面试题2020.07 之滑动窗算法(阿里云面试)
- JSONObject遍历的时候顺序不一致,导致数据对应出错
- MUI无法滚动?完美解决
- P7 Alibaba Interview Questions 2020.07 Sliding Window Algorithm (Alibaba Cloud Interview)
- 2019南昌网络赛 C题,Hello 2019
- 排序第四节——归并排序(附有自己的视频讲解)
- 高项 03 项目立项管理
- way of thinking problem-solving skills
猜你喜欢
随机推荐
leetcode 之盛水问题
vim 程序编辑器的基本操作(积累)
力扣第 305 场周赛复盘
高项 01 信息化与信息系统
Common Oracle Commands
MongDb query method
Unity first lesson
Introduction and use of BeautifulSoup4
浅识微服务架构
95后,刚工作2-3年就年薪50W+ ,才发现打败我们的,从来不是年龄···
查看日志常用命令
failed (13: Permission denied) while connecting to upstream
MySQL高级特性之分布式(XA)事务的介绍
Mysql实操
Integer 线程安全的
事务总结
leetcode 之 70 爬楼梯问题 (斐波那契数)
Codeforces Round #359 (Div. 2) C. Robbers' watch 暴力枚举
【MySQL】update mysql.user set authentication_string=password(“123456“) where User=‘root‘; 报错
postgresql窗口功能