Codeforces Round 984 (Div. 3)
Codeforces Round 984 (Div. 3)赛时最后一道没有写出来,但是现在看最后一道依然很难受😡 A. Quintomaniahttps://codeforces.com/contest/2036/problem/A 1234567891011121314151617181920212223242526272829303132333435363738#include<bits/stdc++.h>using namespace std;using u32 = unsigned;#define i128 __int128using ll = long long;//#define int llusing u64 = unsigned long long;const ll inf = 1e9;const ll INF = 1e18;void solve(){ int n; cin>>n; vector<int>a(n+1); for(int...
AtCoder Beginner Contest 377
AtCoder Beginner Contest 377D - Many Segments 2https://atcoder.jp/contests/abc377/tasks/abc377_d 创建一个dp数组,dp[i]为第i个位置右边第一个区间的右边界。题中给了n组l和r,对于l来说,dp[l]=r;对于其他位置来说,从右往左传递状态,dp[i]=min(dp[i],dp[i+1]),然后对于每一个位置l来说,r所能到达的最右边的位置就是dp[l]-1,所以对于每一个l来说,有dp[l]-l个区间。 123456789101112131415161718192021222324252627282930313233343536#include<bits/stdc++.h>using namespace std;using u32 = unsigned;#define i128 __int128;using ll = long long;//#define int llusing u64 = unsigned long long;const ll...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment
树状数组
树状数组树状数组的学习可以看b站董晓算法的讲解(极力推荐)。 董老师树状数组博客 oiwiki 大概的思路 无论是往点修往后跳还是求前缀和往前跳都是一次跳2^k^,k为x二进制最低有效位。 代码模版123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354template<typename T>struct Fenwick{ int n; vector<T> tr; Fenwick(int n) : n(n), tr(n + 1, 0){} int lowbit(int x){// 找到x最低有效位 return x & -x; } void modify(int x, T c){// 点修 for(int i = x; i <= n; i += lowbit(i))...
hexo博客搭建
hexo hexo文档 butterfly butterfly文档 hexo博客搭建配置的前提条件githttps://git-scm.com/ git的安装也比较简单。我们安装这个主要使用的就是其中的命令行工具git bash。 就是这个玩意。这里建议使用管理员身份打开,会省去一些麻烦 Git Bash:Git提供的命令行工具 ==相当于一个小的linux窗口,使用shift+鼠标右键可以直接找到,不用选择更多选项== 使用git之前需要设置一下用户信息,这里我之前已经配置过了,所以就没有在进行尝试。 打开Git Bash 设置用户信息git config --global user.name “itcast”git config --global user.email “hello@itcast.cn” 查看配置信息git config --global user.namegit config --global user.email 效果如下 Node.jsnodejs.org 这个下载直接下载,安装直接一直点next就行了...