BZOJ 2530 Poi2011 Party Description Byteasar intends to throw up a party. Naturally, he would like it to be a success. Furthermore, Byteasar is quite certain that to make it so it suffices if all invited guests know each other. He is currently trying…
2277: [Poi2011]Strongbox Time Limit: 60 Sec Memory Limit: 32 MBSubmit: 527 Solved: 231[Submit][Status][Discuss] Description Byteasar is a famous safe-cracker, who renounced his criminal activity and got into testing and certifying anti-burglary dev…
斐波那契数列<10^9的数很少很少...所以直接暴力枚举就行了... ------------------------------------------------------------- #include<cstdio> #include<algorithm> #include<cstring> #include<iostream> #define rep( i , n ) for( int i = 0 ; i < n ; ++i )…
[Poi2011]Dynamite Time Limit: 30 Sec Memory Limit: 128 MBSubmit: 270 Solved: 138[Submit][Status][Discuss] Description The Byteotian Cave is composed of n chambers and n-1 corridors that connect them. For every pair of chambers there is unique way…
2525: [Poi2011]Dynamite Time Limit: 30 Sec Memory Limit: 128 MBSubmit: 240 Solved: 120[Submit][Status][Discuss] Description The Byteotian Cave is composed of n chambers and n-1 corridors that connect them. For every pair of chambers there is uniqu…
Description Byteasar the gardener is growing a rare tree called Rotatus Informatikus. It has some interesting features: The tree consists of straight branches, bifurcations and leaves. The trunk stemming from the ground is also a branch. Each branch…
题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=2212 思路:用线段树合并求出交换左右儿子之前之后逆序对的数量,如果数量变小则交换. 实现代码: #include<bits/stdc++.h> using namespace std; #define ll long long ; int n,cnt,idx; ll ans,cnt1,cnt2; int v[M],l[M],r[M],root[M]; ],ls[M*],rs[M*];…
Description A word consisting of lower-case letters of the English alphabet ('a'-'z') is given. We would like to choose a non-empty contiguous (i.e. one-piece) fragment of the word so as to maximise the difference in the number of occurrences of the…