- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 2021暑假牛客多校第四场补题:
2021暑假牛客多校第四场补题:E题 Tree Xor:Tree Xor题目描述:给定一棵树和每条边的边权 对每个点给定一个范围[l,r]边权定义为两个点的值的异或求有多少个点值满足对于所有的点 点值属于区间[l,r]题解:确定一个点的值则其余所有点的值都确定下来先考虑一个简单的问题 如果边权是两个点的差值(假设编号大的点的点值大)那么要求多少个点就相当于将每个区间或减或加然后对所有区间求交集比如现在的树是一条链1-2-3-4 边权依次为 1 1 2 区间依次为[3,4] ,[2,5
2021-09-04 18:01:34
144
原创 倍增专题
(未完成)其实就是在牛客上找了几道题刷一下。A 紧急集合题目树上给出已知三点,找一点使得三点到这点距离最短,查询次数为5e5思路就是找两两的LCA,选择其中不同的那个就是,距离可以直接用深度算出来。#include<bits/stdc++.h>using namespace std;const int maxn=5e5+5;int head[maxn],f[20][maxn],dep[maxn],lg[maxn],cnt,n,q;struct node{ int v; i
2021-05-05 13:32:24
228
原创 B Button Lock
B button lockB. Button Locktime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are standing in front of the room with great treasures. The only thing stopping you is the door with a push-button co
2021-05-02 15:01:52
294
原创 Letter Wheels
题目链接: https://ac.nowcoder.com/acm/contest/15329/I.题目描述There are three horizontal wheels of letters stacked one on top of the other, all with the same number of columns. All wheels have one letter, either ‘A’, ‘B’ or ‘C’, in each of its columns on the edg
2021-04-25 23:50:46
217
原创 HDU1074字典序+状压
HDU1074字典序+状压题干Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after the deadline, the tea
2021-03-21 10:59:23
126
原创 状态压缩dp模板 poj1185 炮兵布阵
POJ1185 炮兵阵地Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 38970 Accepted: 14870Description司令部的将军们打算在NM的网格地图上部署他们的炮兵部队。一个NM的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在
2021-03-11 17:20:56
88
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人