摘要:
Archie 显然是要求逆序对的,这东西当然可以用树状数组求就可以了 然后呢,对于每一个点i,它为后面的点的话,那$j>i$的时候就会有贡献 扫就行了 #include<iostream> #include<cstdio> #include<algorithm> #define ll long lo 阅读全文
摘要:
Archie 显然做法就是建反图,每个点都遍历一下,然后能过 然而有几个点死能卡常数,怎么办呢 干他 如果一头牛不能到达所有奶牛,它能到的所有牛都不行,同理,如果一头奶牛可以,它能到的所有牛都行 然而,这么干还是会被最后一个点干掉。 采用vector,对于每一个点的出边从小到大排序,因为最后枚举是 阅读全文
摘要:
Archie 虽然只是个普通的普及 但我还要写一些 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n; string s[30]; bool cmp 阅读全文
摘要:
Archie 区间加和单点查询 很简单的思路就是$O(\sqrt)修改和o(1)$查询,就像线段树一样搞。一个tag #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std 阅读全文
摘要:
Archie 出个好好的题卡什么输出格式 很简单的模拟退火 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #include<ctime> using namespac 阅读全文
摘要:
Archie 很显然的换根dp #include<iostream> #include<cstdio> #include<cstring> using namespace std; int son[100001]; int dis[100001]; int n; int a,b; int head[ 阅读全文
摘要:
Archie 显然这玩意可以胡搞 怎么搞 模拟退火基本知识 #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; double delat=0.993; double 阅读全文
摘要:
Archie 拉格朗日插值法 知道了n个点的坐标,构造出一个n次多项式 然后求f(x) 公式 $ f_k=\sum_^ny_i\prod_{j=1\quad j\neq i }^n\frac$ 就行了 #include<iostream> #include<cstdio> #include<cstr 阅读全文
摘要:
Archie 记忆化搜索就好 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int m; int x; int a[10005]; int n,k; int 阅读全文
摘要:
Archie 还是很水的 注意一下边界 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n,m; int d[10001]; int dp[10005 阅读全文
摘要:
dpdpdp Archie 很显然,每一层之间有最优子结构 那么,怎么转移呢,既然两个方向,那就加一维从哪里走 #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> #define int long lon 阅读全文
摘要:
Archie 一道比较显然的构造题 呸 显然1和0的数量都需要是偶数,不然必挂 显然开头和结尾必须相互匹配,不然也挂 然后用1把这里分成一小块一小块,每一块,如果有偶数个零,显然可行 奇数个零的块必然成双存在,同上处理 01分开构造 #include<iostream> #include<cstri 阅读全文
摘要:
Archie 首先很显然的是,无论怎么选,这里肯定会有一条贯穿的横向和一条纵向的骨架 那么问题来了,剩下的呢 按照大小一个一个插,不要有环出现 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #def 阅读全文
摘要:
P2736 [USACO3.4]“破锣摇滚”乐队 Raucous Rockers 死小的数据范围 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n, 阅读全文
摘要:
[Archie]([P1006 NOIP2008 提高组] 传纸条 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)) 一步一步的走有点烦,何不走两步一次 #include<iostream> #include<cstdio> #include<algorithm> using na 阅读全文
摘要:
Archie 很简单的小模拟 我们把每四位数和一个:作为一段进行处理 小小的特判 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; string s; int a[9]; int main(){ 阅读全文
摘要:
sczyyds sczyyds sczyyds I can't forget 你需要知道怎么求位数 #include<cmath> #include<cstdio> #include<iostream> #define ll long long using namespace std; ll n; 阅读全文
摘要:
这里应该写什么 很显然,先把所有学生排序并且分组 然后,把两个组合并 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define int long long using namespace std 阅读全文
摘要:
FOGGY 记忆化搜索 改变每一个叶子节点,它的影响是线性的往根节点走 也就是说,如果一个父节点在这条路径上改变了,并且这种改变会影响到根节点那么应该标记, 同理,没有影响的改变 也就是说,标记某个节点的改变的影响 那么怎么具体搞呢 对于每一种操作,单独分析 \(O(n^2)\) #include< 阅读全文
摘要:
Aimee 很显然,对于每一行来讲,如果他们$gcd(x,y)$不为1,那么这个斜率一定出现过,所以说呢,需要排除 再结合一下对称性,可以知道对于每一列,可用的点对就是$\psi(x)$ 最后的答案就是$3+2*\sum_{i=2}^{n-1}\psi(i)$ 为什么是n-1呢,因为体委再(1,1) 阅读全文