题目: You are given one string S consisting of only '0' and '1'. You are bored, so you start to play with the string. In each operation, you can move any character of this string to some other position in the string. For example, suppose . Then you can…
A. Hacker Cups and Balls 二分答案,将$\geq mid$的数看成$1$,$<mid$的数看成$0$,用线段树进行区间排序检查即可.时间复杂度$O(n\log^2n)$. #include<cstdio> #include<algorithm> using namespace std; const int N=100010,M=262150; int n,m,i,a[N],e[N][2],l,r,MID,ans; int len[M],c1[M],ta…
  D 考虑每个点被删除时其他点对它的贡献,然后发现要求出距离为1~k的点对有多少个. 树分治+FFT.分治时把所有点放一起做一遍FFT,然后减去把每棵子树单独做FFT求出来的值. 复杂度$nlog^2n$ #include<bits/stdc++.h> #define N 270000 #define pi acos(-1) #define ll long long #define inf 0x3f3f3f3f using namespace std; const int p = 10000…
题目:Statements Dreamoon likes algorithm competitions very much. But when he feels crazy because he cannot figure out any solution for any problem in a competition, he often draws many meaningless straight line segments on his calculation paper. Dreamo…
题目: Dreamoon likes algorithm competitions very much. But when he feels crazy because he cannot figure out any solution for any problem in a competition, he often draws many meaningless straight line segments on his calculation paper. Dreamoon's calcu…
The Android University ACM Team Selection Contest Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述  Now it's 20000 A.D., and the androids also participate in the ACM Inter-national Collegiate Programming Contest (ACM/ICPC). In order to sele…
链接:知乎 [点击查看大图] 原图来自LearnCodeAcademy最火的视频,learncode是YouTube上最火的Web开发教学频道,介绍包括HTML/CSS/JavaScript/Sublime Text/CSS Layouts/Responsive Design/React.js/Node.js/Angular.js/Backbone.js/Docker/Dev Ops/Server Administration/Deployment Strategies在内的各类教学视频,拥有超…
luogu 1327 数列排序 题意 给定一个数列\(\{an\}\),这个数列满足\(ai≠aj(i≠j)\),现在要求你把这个数列从小到大排序,每次允许你交换其中任意一对数,请问最少需要几次交换? 思路 找循环节.答案即为 (循环节的长度\(-1\)) 对所有循环节求和. 如果只能交换相邻两个,那么就是求逆序对个数.因为交换相邻两个数字的效果是使逆序对个数\(-1\). Code #include <bits/stdc++.h> #define maxn 100010 using name…
A. As Easy As Possible 每个点往右贪心找最近的点,可以得到一棵树,然后倍增查询即可. 时间复杂度$O((n+m)\log n)$. #include <bits/stdc++.h> using namespace std ; typedef long long LL ; typedef long long Int ; typedef pair < int , int > pi ; #define clr(a,x) memset ( a , x , sizeof…
https://community.mindjet.com/mindjet/topics/ensure-2017-64-bit-version-installation Mindmanager should automatically pick same bit rate version based on MS office Bit version while installing.The combined installer detects the bit version of Microso…