当前位置:网站首页>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
边栏推荐
猜你喜欢
makefile记录
排序第三节——交换排序(冒泡排序+快速排序+快排的优化)(5个视频讲解)
【Oracle 11g】Redhat 6.5 安装 Oracle11g
【报错】Root Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The working principle of the transformer (illustration, schematic explanation, understand at a glance)
排序第一节——插入排序(直接插入排序+希尔排序)(视频讲解26分钟)
The Integer thread safe
DSP+ARM+FPGA高速PCIE/千兆网口信号仿真介绍
虚拟机网卡报错:Bringing up interface eth0: Error: No suitable device found: no device found for connection
高项 04 项目变更管理
随机推荐
【ROS2原理8】节点到参与者的重映射
makefile记录
类和结构体
MUI无法滚动?完美解决
Quectel EC20 4G module dial related
jvm线程状态
leetcode 之 70 爬楼梯问题 (斐波那契数)
The working principle of the transformer (illustration, schematic explanation, understand at a glance)
洛谷P1110 报表统计 multiset stl好题
AD的library中 库文件后缀有.intlib .schlib .pcblib 的区别
Reverse Engineering
浅识微服务架构
DSP+ARM+FPGA高速PCIE/千兆网口信号仿真介绍
postgresql Window Functions
mysql summary
【转载】Deep Learning(深度学习)学习笔记整理
Explain the wait() function and waitpid() function in C language in detail
字节跳动笔试题2020 (抖音电商)
搭载开源鸿蒙系统的嵌入式XM-RK3568工业互联方案
高项 04 项目变更管理