Garlands 我怎么感觉好水啊. 因为询问只有2000组, 离线询问, 枚举联通块再枚举询问, 二维树状数组更新答案. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pair<LL, int> #define PII pair<int…
E. Garlands 题目连接: http://www.codeforces.com/contest/707/problem/E Description Like all children, Alesha loves New Year celebration. During the celebration he and his whole family dress up the fir-tree. Like all children, Alesha likes to play with gar…
C. Three Garlands time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mishka is decorating the Christmas tree. He has got three garlands, and all of them will be put on the tree. After that Mi…
主席树 其实暴力二维树状还更快 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 2005; int N,M,K,Q; struct Node{ int x,y,w; Node(int a=0, int b=0, int c=0):x(a),y(b),w(c){} bool operator < (Node T) { if(x != T.x) return x <…
题目链接:http://codeforces.com/contest/707/problem/A A. Brain's Photos time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Small, but very brave, mouse Brain was not accepted to summer school of y…