2024-08-07 04:01:04 +00:00
|
|
|
|
# bdfz_2024_summer
|
2024-08-04 08:44:14 +00:00
|
|
|
|
# 题目经验总结
|
|
|
|
|
## Day2
|
2024-08-04 08:59:34 +00:00
|
|
|
|
### [U111091 区间2段覆盖](./day2/U111091/U111091.md)
|
2024-08-04 08:45:36 +00:00
|
|
|
|
1. 不要以小单位的路段为前缀和最小单位,要以房屋为前缀和最小单位\
|
2024-08-02 04:45:18 +00:00
|
|
|
|
|
2024-08-04 08:59:34 +00:00
|
|
|
|
## Day3
|
|
|
|
|
### [U86432 捞鱼(fish)](./day3/U86432/U86432.md)
|
|
|
|
|
1. 数据离散化是指把数据只保留有用的东西,在本题当中指的是把数据排序后保存顺序关系,让内存数组可以少一些
|
2024-08-04 10:10:08 +00:00
|
|
|
|
2. 看到哪个东西的数据量最少,实在不行就从那个东西下手
|
|
|
|
|
|
|
|
|
|
### [T490194 还原排列](./day3/T490194/T490194.md)
|
|
|
|
|
1. 学会使用`bool next_permutation(begin,end)` 进行排列组合,没有下一个组合时会返回false,下面是一个示例
|
|
|
|
|
```cpp
|
|
|
|
|
#include<bits/stdc++.h>
|
|
|
|
|
using namespace std;
|
|
|
|
|
typedef unsigned int u32;
|
|
|
|
|
ostream& operator<<(ostream &os,const vector<int> &v){
|
|
|
|
|
os<<"vector<int> [";
|
|
|
|
|
for(u32 i=0;i<v.size();i++){
|
|
|
|
|
os<<v[i]<<(i!=v.size()-1?",":"]");
|
|
|
|
|
}
|
|
|
|
|
return os;
|
|
|
|
|
}
|
|
|
|
|
int n;
|
|
|
|
|
int main(){
|
|
|
|
|
cin>>n;
|
|
|
|
|
vector<int> v(n);
|
|
|
|
|
for(int &i:v){
|
|
|
|
|
cin>>i;
|
|
|
|
|
}
|
|
|
|
|
cout<<"v:"<<v<<endl;
|
|
|
|
|
while(next_permutation(v.begin(),v.end())){
|
|
|
|
|
cout<<"v_pered"<<v<<endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
```
|
2024-08-04 08:59:34 +00:00
|
|
|
|
|
2024-08-06 03:41:16 +00:00
|
|
|
|
## Day4
|
|
|
|
|
### [T435167 01 Sort](./day4/T435167/T435167.md)
|
|
|
|
|
#### 通过异色中转
|
2024-08-06 04:15:08 +00:00
|
|
|
|
#### 环
|
2024-08-06 03:41:16 +00:00
|
|
|
|
|
2024-08-07 02:06:20 +00:00
|
|
|
|
## Day5
|
|
|
|
|
### 需要学习的点
|
2024-08-07 03:26:16 +00:00
|
|
|
|
#### 区间最值
|
|
|
|
|
#### 弄懂分数取模出现很大的数字是什么鬼、
|
|
|
|
|
1. >费马小定理
|
|
|
|
|
2. >逆元
|
|
|
|
|
```cpp
|
|
|
|
|
// a/b%M
|
|
|
|
|
ll _ksm(ll a, ll b,ll M){
|
|
|
|
|
ll res = 1;
|
|
|
|
|
while(b) {
|
|
|
|
|
if(b & 1)
|
|
|
|
|
res = res * a % M;
|
|
|
|
|
a = a * a % M;
|
|
|
|
|
b >>= 1;
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ll ksm(ll a,ll b,ll M){
|
|
|
|
|
return a * _ksm(b, M - 2,M) % M;
|
|
|
|
|
}
|
|
|
|
|
```
|
2024-08-07 04:01:04 +00:00
|
|
|
|
### 比赛疑问
|
|
|
|
|
#### [公平的竞争(fair)](./day5/statement.pdf)
|
|
|
|
|
##### $x=2+ {{x}\over{4}}$ => $x = {{8} \over 3}$是怎么得出来的
|
2024-08-07 02:06:20 +00:00
|
|
|
|
|
2024-08-07 05:33:35 +00:00
|
|
|
|
# [RMQ 区间最值问题](./day5/RMQ_by_chat.md)
|
|
|
|
|
>点击跳转
|
2024-08-07 07:46:28 +00:00
|
|
|
|
[自己手动实践](./day5/RMQ/st.cpp)
|
2024-08-07 04:06:04 +00:00
|
|
|
|
|
2024-08-08 08:26:44 +00:00
|
|
|
|
## Day6
|
|
|
|
|
[CSP-S1 模拟赛.pdf](./day6/CSP-S1%20模拟赛.pdf)
|
|
|
|
|
>??:4.13.14.20.21
|
|
|
|
|
## T9
|
|
|
|
|
1. 先与后或先&后|
|
|
|
|
|
|
2024-08-09 01:07:47 +00:00
|
|
|
|
## Day7
|
|
|
|
|
### 离线算法和在线算法
|
|
|
|
|
>有预处理和没有预处理的区别
|
|
|
|
|
|
2024-08-03 08:41:01 +00:00
|
|
|
|
# 排序
|
|
|
|
|
## 稳定性
|
|
|
|
|
>隔着老远swap一般不稳定
|
|
|
|
|
>稳定:插入,归并,冒泡
|
2024-08-04 03:59:29 +00:00
|
|
|
|
|
|
|
|
|
# 竞赛的一些方法
|
|
|
|
|
|
|
|
|
|
1. 真正难的地方是通过题目给的信息和性质推出要用的算法
|