
ACM
文章平均质量分 57
解题报告
xuziling_
这个作者很懒,什么都没留下…
展开
-
【dp+超巧妙的线段树】codeforces 1197E. Culture Code
【dp+超巧妙的线段树】codeforces 1197E. Culture Code【题目链接】题目There are famous Russian nesting dolls named matryoshkas sold in one of the souvenir stores nearby, and you’d like to buy several of them. The sto...原创 2019-07-27 11:50:59 · 356 阅读 · 0 评论 -
WHU校赛2019 Online F. Climb(树上主席树)
WHU校赛2019 Online F. Climb[没有链接]题目JBT is going to climb the mountain, but he was suddenly trapped into an unknown enchantment.There are n mountains, connected by n−1 paths. There is only one road ...原创 2019-04-07 20:11:39 · 240 阅读 · 0 评论 -
HDU - 6000 Wash 贪心+优先队列
HDU - 6000 Wash 贪心+优先队列【vj链接】题目Mr.Panda is about to engage in his favourite activity doing laundry! He’s brought L indistinguishable loads of laundry to his local laundromat, which has N washing ...原创 2018-11-18 20:22:34 · 193 阅读 · 0 评论 -
【机智的图论】牛客2018多校第十场 F. Rikka with Line Graph
【机智的图论】牛客2018多校第十场 F. Rikka with Line Graph【题目链接】题目描述Line Graph L(G) can be considered as an operator on an undirected graph G just like Complementary Graph and Dual Graph.Rikka generalize...原创 2018-08-21 17:33:27 · 879 阅读 · 0 评论 -
【二分+状压dp】Codeforces Round #384 (Div. 2) E. Vladik and cards
【二分+状压dp】Codeforces Round #384 (Div. 2) E. Vladik and cards【vj链接】题目Vladik was bored on his way home and decided to play the following game. He took n cards and put them in a row in front of hi...原创 2018-08-16 17:34:43 · 179 阅读 · 0 评论 -
【动态主席树,带lazy标记的区间更新求和】HDU - 4348 To the moon
【动态主席树,带lazy标记的区间更新求和】HDU - 4348 To the moon【vj链接】题目Background To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker. The ...原创 2018-08-11 17:36:30 · 289 阅读 · 0 评论 -
【动态主席树】 ZOJ 2112 Dynamic Rankings
【动态主席树】 ZOJ 2112 Dynamic Rankings【vj链接】题目求区间第k小,有单点更新输入T组数据n个点Q个询问n个点Q行Q个询问 以Q开头的三个数 l r k 表示询问 [l,r] 第 k 小 以C开头的俩数x y 表示把 a[x] 换成 y输出每个询问对应的第 k 小的数Sample Input25 33 2 1 ...原创 2018-08-10 17:06:12 · 142 阅读 · 0 评论 -
【神奇的dp】poj 6357 Hills And Valleys
【神奇的dp】poj 6357 Hills And Valleys【题目链接】题目Problem DescriptionTauren has an integer sequence A of length n (1-based). He wants you to invert an interval [l,r] (1≤l≤r≤n) of A (i.e. replace Al,A...原创 2018-08-07 10:43:07 · 285 阅读 · 0 评论 -
【求最长公共前缀 后缀数组】hdu1403
【求最长公共前缀 后缀数组】hdu1403【vj链接】题目内容给两个字符串,求最长公共子串,多组数据,长度1e5解题思路利用后缀数组的性质,把两个串连起来,找最大的满足公共串部分分别在两个字符串里的height。AC代码#include <iostream>#include <cstdio>#include <cstri...原创 2018-08-06 10:13:49 · 299 阅读 · 0 评论 -
【分块dp】HDU 6331 Problem M. Walking Plan
【分块dp】HDU 6331 Problem M. Walking Plan【题目链接】题目大意T组数据 每组n个点m条边,给一个有向图,边有长度。 接下来Q个询问 每次问u到v至少经过x个点的最短距离InputThe first line of the input contains an integer T(1≤T≤10), denoting the numbe...原创 2018-07-31 15:45:05 · 197 阅读 · 0 评论 -
【dfs 组合数】code forces 991E Bus Number
【dfs 组合数】code forces 991E Bus Number【题目链接】题目内容给一个看到的数n(1&lt;=n&lt;=1e18),无前导0,求实际的数x有多少种可能。 n与x的关系是,1.n中出现的数,x中也出现。2.x中任何一个数出现的次数不超过其在n中出现的次数。解题思路1e18范围内最多就只有19个数,先把0,1,2……的数量都统计出...原创 2018-07-25 09:26:02 · 215 阅读 · 0 评论 -
【矩阵快速幂】code forces 631E
【矩阵快速幂】code forces 631E【题目链接】题目内容There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit from eac...原创 2018-07-24 21:12:17 · 302 阅读 · 0 评论 -
POJ 1742 coins (奇怪的多重背包)
题目给出n种货币和货币数量,求其能凑出的不超过m的和有多少种。InputThe input contains several test cases. The first line of each test case contains two integers n(1<=n<=100),m(m<=100000).The second line contains 2n...原创 2018-07-21 14:41:44 · 175 阅读 · 0 评论 -
codeforces 500E New Year Domino(线段树预处理+倍增)
codeforces 500E New Year Domino(线段树预处理+倍增)【题目链接】解题思路先用线段树预处理能达到的最远长度,就是从后往前,对每个点,二分找到它能到的最远的木棒,找到这其中的最远距离,更新。 对每一个点,向推倒它之后第一个不能被波及到的木棒连一条边,记录一个花费。 用dp[i][j]表示第i个点走过2的j次方条边后到达的点,同时记录花费。 dp[...原创 2018-06-05 17:04:58 · 276 阅读 · 0 评论 -
POJ - 2481 Cows (单点更新,区间查询(求和)的树状数组)
POJ - 2481 Cows (单点更新,区间查询(求和)的树状数组)【vj链接】题目Farmer John’s cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in h...原创 2018-05-22 14:27:01 · 194 阅读 · 0 评论 -
HDU - 2665 Kth number (主席树经典题,求区间第K小)
HDU - 2665 Kth number (主席树经典题,求区间第K小)【题目链接】【大佬博客链接】题目Give you a sequence and ask you the kth big number of a inteval. Input The first line is the number of the test cases. For each test...原创 2018-05-18 21:26:22 · 198 阅读 · 0 评论 -
2018华科校赛A题 -- Beauty of Trees(带权并查集)
2018华科校赛A题 – Beauty of Trees(带权并查集)【题目链接】题目描述It’s universally acknowledged that there’re innumerable trees in the campus of HUST. One day the tree manager wants to play a game with you. There...原创 2018-05-10 21:13:27 · 409 阅读 · 0 评论 -
POJ1182 -- 食物链 (带权并查集经典例题)
POJ1182 – 食物链 (带权并查集经典例题)【题目链接】题目食物链Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1...原创 2018-05-10 19:33:00 · 227 阅读 · 0 评论 -
二维RMQ模板
二维RMQ模板const int maxn=100+7;int n,m;int dp[maxn][maxn][10][10],val[maxn][maxn];void init(){ for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { ...转载 2018-05-02 21:41:34 · 150 阅读 · 0 评论 -
矩阵快速幂模板
矩阵快速幂模板const int maxarr=7;//矩阵大小LL aa,bb;struct node{ LL arr[maxarr][maxarr];};void init(node &a)//所有新建都要手动清空{ for(int i=0;i<maxarr;i++) { for(int j=0;j<maxarr;j...原创 2018-05-02 20:15:23 · 122 阅读 · 0 评论 -
第十四届华中科技大学程序设计竞赛 I 题 Neat Tree
Neat Tree【题目链接】题目链接:https://www.nowcoder.com/acm/contest/106/I 来源:牛客网题目描述 It’s universally acknowledged that there’re innumerable trees in the campus of HUST.There is a row of trees alo...原创 2018-04-30 17:40:53 · 296 阅读 · 0 评论 -
dijkstra 模板
int dis[maxn],vis[maxn],pre[maxn],n;struct node///to为点的编号,d为边权或者最短路{ int to,d;}f,ne;struct cmp{ bool operator() (node a,node b) { return a.d>b.d; }};vector <node&g...原创 2018-04-26 20:32:10 · 228 阅读 · 0 评论 -
Punching Power Gym - 101670J (二分图最大独立点集匈牙利算法(模板))
Punching Power Gym - 101670J (二分图最大独立点集匈牙利算法(模板))【vj链接】题目大意与解题思路给n[1,2000 ]个点的二维平面坐标,选一个最大的点的集合,要求其中任意两点距离不能大于1.3。1.3是一个很特别条件,因为给出的点都是整数点,所以就是上下相邻和左右相邻的不能同时出现,这就是一个二分图,同一条反斜线上的点的特征是横纵坐标值之和...原创 2018-04-21 21:14:15 · 347 阅读 · 0 评论 -
Tarjan 模板
#include <bits/stdc++.h>#define LL long longusing namespace std;#define maxn 200007const int INF=0x3f3f3f3f;int DFN[maxn],low[maxn],num,index;bool inStack[maxn];vector <int> G[ma...原创 2018-04-16 21:59:16 · 606 阅读 · 1 评论 -
HDU - 4856 Tunnels (预处理+状压dp)
HDU - 4856 Tunnels (预处理+状压dp)【hud链接】 【vj链接】题目Problem DescriptionBob is travelling in Xi’an. He finds many secret tunnels beneath the city. In his eyes, the city is a grid. He can’t enter ...原创 2018-04-14 16:39:25 · 295 阅读 · 0 评论 -
2018年东北农业大学春季校赛
【题目】A wyh的曲线 10/51 未通过学一下求曲线长度?B wyh的矩阵 461/1355 通过规律题方便打表的先打表再推C wyh的商机 12/31 未通过离线LCA?D wyh的迷宫 383/1149 通过E wyh的阶乘 630/1711 通过阶乘末尾的0由其中5的因子的个数决定,这道题思...原创 2018-04-07 22:22:40 · 287 阅读 · 0 评论 -
CodeForces - 514C Watto and Mechanism(字典树)
CodeForces - 514C Watto and Mechanism(字典树)【vj链接】 【cf链接】题目Watto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings in a certain way. Initia...原创 2018-04-04 21:29:49 · 275 阅读 · 0 评论 -
KMP模板1(便于理解)(poj3461)
KMP模板1(便于理解)(poj3461)优化后的模板(不需要memset)void get_Next(const string &a,int Next[],int len){ Next[0]=-1; int k=-1; for(int i=1;i<len;i++) { while (k>=0 && ...原创 2018-03-28 21:29:21 · 156 阅读 · 0 评论 -
UVa 12118 - Inspector's Dilemma(并查集,欧拉回路)
UVa 12118 - Inspector’s Dilemma(并查集,欧拉回路)【vj链接】题目In a country, there are a number of cities. Each pair of city is connected by a highway, bi-directional of course. A road-inspector’s task is...原创 2018-03-23 20:46:40 · 322 阅读 · 0 评论 -
概率dp
Problem K. A game (High)Input file: stdin Output file: stdout Time limit: 1 sec Memory limit: 256 MbAlex met a friend who invited him to play for the collectible card. The game divided on a...原创 2018-03-22 22:20:17 · 142 阅读 · 0 评论 -
tarjan判环(51Nod - 1076)
tarjan判环(51Nod - 1076)51Nod - 1076 vj链接模板int DFN[maxn],low[maxn],cnt=0;bool vis[maxn],inStack[maxn];///每次使用要清空vector <int> edge[maxn];stack <int> st;void dfs(int u,int pre...原创 2018-03-20 23:34:00 · 1121 阅读 · 0 评论 -
【模板】Dijkstra \ Floyed \ Prim
Dijkstraint dis[maxn],vis[maxn],pre[maxn];void dijkstra()//不能有负权边{ int i,j; for(i=0;i { dis[i]=map[begin][i]; vis[i]=0; pre[i]=-1; } dis[begin]=0;原创 2018-01-19 18:59:50 · 155 阅读 · 0 评论 -
【解题报告】Tree Destruction CodeForces - 911F(搜索??)
【解题报告】Tree Destruction CodeForces - 911F(搜索??)====================================================================【cf链接】【vj链接】==================================================================原创 2018-01-08 17:21:42 · 584 阅读 · 1 评论 -
最长递增子序列
最长递增子序列原创 2017-12-30 16:34:18 · 115 阅读 · 0 评论 -
字典树模板
字典树模板原创 2017-12-29 15:48:51 · 148 阅读 · 0 评论 -
【动态规划】POJ - 2192 Zipper
【动态规划】POJ - 2192 ZipperDescriptionGiven three strings, you are to determine whether the third string can be formed by combinin原创 2017-12-27 16:45:43 · 826 阅读 · 0 评论 -
【dp】POJ - 1080 Human Gene Functions
【dp】POJ - 1080 Human Gene Functions【poj链接】 【vj链接】题目大意给两个字符串包括A,C,G,T,一一对应的组合有权重,加入’-‘使两字符串长度相等,求最大权重和,注意:两个’-‘不可对应。 InputThe input consists of T test cases. The number of test cases ) (T is given in原创 2017-12-04 22:36:40 · 156 阅读 · 0 评论 -
【kruskal裸题】 POJ - 1251 Jungle Roads
【kruskal裸题】 POJ - 1251 Jungle Roads The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago.原创 2017-11-22 19:03:06 · 201 阅读 · 0 评论 -
【动态规划】Alternating Strings Gym - 100712D
【动态规划】Alternating Strings Gym - 100712D从后向前dp原创 2017-11-21 20:03:14 · 262 阅读 · 0 评论 -
【线段树模板】
求和模板#include <cstdio>#include <iostream>#include <algorithm>using namespace std;const int maxn=100000+100;struct SegmentTree{ int l,r,lz,sum;}tree[maxn<<2];in...原创 2017-11-17 17:12:46 · 137 阅读 · 0 评论