摘要: 题目:货仓选址 link:https://www.acwing.com/problem/content/106/ 分析 code #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int arr[N], n; 阅读全文
posted @ 2022-07-28 16:30 SL霸霸 阅读(418) 评论(0) 推荐(0) 编辑
摘要: 离散化 什么是离散化? 一些数据范围比较大,但是数据的个数不多,将其数字映射成较小的下标 从本质上来看离散化可以看成哈希,是一种特殊的哈希,其保证数据在哈希以后仍然保持原来的顺序 离散化的步骤 排序 去重(排序好了才能去重,可以用stl中的unique去重然后用erase去除) 访问的时候可以通过二 阅读全文
posted @ 2022-07-28 12:22 SL霸霸 阅读(99) 评论(0) 推荐(0) 编辑