Go to file
Zengtudor 2f26018eca update 2024-08-06 23:07:10 +08:00
.vscode update problems 2024-08-06 08:31:25 +08:00
day1 remove htmls 2024-08-04 21:03:29 +08:00
day2 update 2024-08-05 15:03:59 +08:00
day3 update 2024-08-04 22:50:57 +08:00
day4 update 2024-08-06 23:07:10 +08:00
.gitignore update 2024-08-06 14:40:39 +08:00
LICENSE Initial commit 2024-08-02 04:45:18 +00:00
README.md update readme day4 morning 2024-08-06 12:15:08 +08:00

README.md

bdfu_2024_summer

题目经验总结

Day2

U111091 区间2段覆盖

  1. 不要以小单位的路段为前缀和最小单位,要以房屋为前缀和最小单位\

Day3

U86432 捞鱼(fish)

  1. 数据离散化是指把数据只保留有用的东西,在本题当中指的是把数据排序后保存顺序关系,让内存数组可以少一些
  2. 看到哪个东西的数据量最少,实在不行就从那个东西下手

T490194 还原排列

  1. 学会使用bool next_permutation(begin,end) 进行排列组合没有下一个组合时会返回false下面是一个示例
#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;
    }
    
}

Day4

T435167 01 Sort

通过异色中转

排序

稳定性

隔着老远swap一般不稳定 稳定:插入,归并,冒泡

竞赛的一些方法

  1. 真正难的地方是通过题目给的信息和性质推出要用的算法