vjudge
穷源溯流
路很长,尽管走便是。
展开
-
DFS 序 2
const int N=1e6+5; int n,m,t; int i,j,k; int a[N]; vector<int> G[N<<1]; int s; int sz[N],son[N],dep[N],fa[N]; void dfs1(int u,int f) { dep[u]=dep[f]+1; fa[u]=f; sz[u]=1; int len=G[u].size(); fo...原创 2020-10-03 10:47:41 · 365 阅读 · 0 评论 -
DFS 序 1
const int N=1e6+5; int n,m,t; int i,j,k; int a[N]; vector<int> G[N<<1]; int s; int sz[N],son[N],dep[N],fa[N]; void dfs1(int u,int f) { dep[u]=dep[f]+1; fa[u]=f; sz[u]=1; int len=G[u].size(); ...原创 2020-10-03 10:37:41 · 235 阅读 · 0 评论 -
A Simple Problem with Integers(区间修改+区间求和)
const int N=1e5+5; int n,m,t; int i,j,k; int a[N]; struct Node { int l, r; ll sum,lazy; void update(int x) { sum+=1ll*(r-l+1)*x; lazy+=x; } }node[N<<2]; ...原创 2020-09-29 22:32:02 · 303 阅读 · 0 评论 -
Dropping tests
题意:戳这里 //#pragma GCC optimize(2) //#include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <vector> #include <functional> #include <cmath> #define...原创 2020-06-21 22:10:00 · 304 阅读 · 0 评论 -
Halloween Costumes
Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these parties are all costume parties, ...原创 2020-04-26 12:37:45 · 596 阅读 · 0 评论 -
Milking Time
Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,000) hours (conveniently labeled 0..N-1) so that ...原创 2020-04-03 21:34:00 · 250 阅读 · 0 评论 -
Dynamic Programming
Dynamic Programming, short for DP, is the favorite of iSea. It is a method for solving complex problems by breaking them down into simpler sub-problems. It is applicable to problems exhibiting the pro...原创 2020-04-02 22:38:19 · 261 阅读 · 0 评论 -
最大两字段和
Sample Input 1 10 1 -1 2 2 3 -3 4 -4 5 -5 Sample Output 13 #include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <cstring> #inc...原创 2020-03-28 20:51:45 · 187 阅读 · 0 评论