LG5227 [AHOI2013]连通图 线段树分治板子。这种动态图的问题看都不要看,大概率可以用线段树分治。 我们有一堆的集合,每次把这个集合的边删掉,问你每个时刻的连通性。 我们只需要把这个时刻删去的集合里的边删掉,也就是这个区间不用加这条边,按常规把边扔到线段树上,遍历一下,每个点的连通性就出 ...
分类:
其他好文 时间:
2021-03-08 13:37:10
阅读次数:
0
思路 方法:首尾双指针 1 class Solution { 2 public: 3 void reverseString(vector<char>& s) { 4 int i = 0, j = s.size()-1; 5 while(i < j) { 6 swap(s[i], s[j]); 7 + ...
分类:
其他好文 时间:
2021-03-08 13:22:36
阅读次数:
0
题目 题目链接:https://www.ybtoj.com.cn/problem/731 \(n,m,Q\leq 2\times 10^5\)。 思路 考场上写了一发 \(O(Q\sqrt{m}\alpha(n))\) 回滚莫队没卡过去。。。 考虑把询问按照右端点离线,我们对于询问 \([l,r]\ ...
分类:
其他好文 时间:
2021-03-01 13:04:19
阅读次数:
0
高斯消元解线性方程组 时间复杂度:O(\(n^3\)) https://www.luogu.com.cn/problem/P3389 题意:给定一个线性方程组,对其求解。 #include <bits/stdc++.h> using namespace std; const char nl = '\ ...
分类:
其他好文 时间:
2021-02-17 14:54:53
阅读次数:
0
1、 安装kubectl 关闭SWAP交换分区 swapoff -a 配置Kubernetes-YUM源 [root@minikube ~]# cat < /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=ht ...
分类:
Web程序 时间:
2021-02-17 14:42:50
阅读次数:
0
/* { ###################### # Author # # Gary # # 2021 # ###################### */ #include<bits/stdc++.h> #define rb(a,b,c) for(int a=b;a<=c;++a) #de ...
分类:
其他好文 时间:
2021-02-15 12:03:57
阅读次数:
0
AT1981 [AGC001C] Shorten Diameter \(solved\) AT1982 [AGC001D] Arrays and Palindrome AT1983 [AGC001E] BBQ Hard \(solved\) AT1984 [AGC001F] Wide Swap AT ...
分类:
其他好文 时间:
2021-02-15 11:56:59
阅读次数:
0
说明 maxscale 配置没有问题,但是就是不好使。 报错如下: warning: [mariadbmon] The current master server 'server1' is no longer valid because it has been down over 5 (failco ...
分类:
数据库 时间:
2021-02-02 11:13:27
阅读次数:
0
在Linux系统中,每个内存地址都是虚拟的。它们不直接指向RAM中的任何地址。每当您访问一个内存位置时,都会执行一种转换机制来匹配相应的物理内存。让我们从一个介绍虚拟内存概念的小故事开始。给定一个旅馆,每个房间都可以有一个电话,每个电话都有一个私人号码。当然,所有安装的电话都是酒店的。他们都不能从酒 ...
分类:
其他好文 时间:
2021-02-02 11:12:12
阅读次数:
0
什么是CAS CAS(compare and swap),字面意思比较并交换,是解决多线程并行情况下使用锁造成性能损耗的一种机制. public final boolean compareAndSet(int expect, int update) { return unsafe.compareAn ...
分类:
编程语言 时间:
2021-01-29 12:10:28
阅读次数:
0