A .Jzzhu and Chocolate pro:现在给定一个大小为N*M的巧克力,让你横着或者竖着切K刀,都是切的整数大小,而且不能切在相同的地方,求最大化其中最小的块. (N,M,K<1e9) sol:如果横着切X刀,竖着切Y刀,那么最小的面积=(N/(X+1))*(M/(Y+1)):一看这个公式知道是整数分块了,相同的部分合并. 需要保证X<N,Y<M: #include<bits/stdc++.h> #define ll long long using names…
A .Artwork pro:给定N*M的白色格子,然后Q次黑棒,输出每次加黑棒后白色连通块的数量.(N,M<1e3, Q<1e4) sol:倒着离线做,并查集即可. (在线做法:https://www.cnblogs.com/asdfsag/p/10485607.html #include<bits/stdc++.h> #define ll long long #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace…
Ultra-QuickSort Time Limit: 7000MS Memory Limit: 65536K Total Submissions: 68874 Accepted: 25813 Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swappin…
Problem Statement You are a genealogist specializing in family trees of vampires. Vampire family trees differ from human family trees. In particular, vampires are "born" in a different way. The only way to create a new vampire is that an ex…