codeforces #257 C称号Jzzhu and Chocolate】的更多相关文章

职务地址:http://codeforces.com/contest/450/problem/C 这次CF的时候绝壁脑残了. ..A题和C题都出现了脑残失误... 唯一一个AC的B题还是被HACK了...分数也不多了...简直sad. . ..... . 这题我的思路是分类讨论.分四种情况. 首先让n>=m,假设不是的话,能够交换.主要是考虑切横的多少刀,竖的多少刀. 1:当k>n+m-2,此时,切不了那么多刀.输出-1. 2:当k>=n,此时.把长的那一段全切了,剩下的切短的. 3:当…
主题链接:http://codeforces.com/problemset/problem/449/A ---------------------------------------------------------------------------------------------------------------------------------------------------------- 欢迎光临天资小屋:http://user.qzone.qq.com/593830943…
C. Jzzhu and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Jzzhu has a big rectangular chocolate bar that consists of n × m unit squares. He wants to cut this bar exactly k time…
C. Jzzhu and Chocolate time limit per test: 1 seconds memory limit per test: 256 megabytes input: standard input output: standard output Jzzhu has a big rectangular chocolate bar that consists of \(n × m\) unit squares. He wants to cut this bar exact…
Jzzhu and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Jzzhu has a big rectangular chocolate bar that consists of n × m unit squares. He wants to cut this bar exactly k times.…
题目链接:http://codeforces.com/contest/450/problem/C 题目意思:给出一个 n * m 大小的chocolate bar,你需要在这个bar上切 k 刀,使得最小的部分面积尽可能大,求出这个被划分后的最小部分面积最大可以为多少.如果这个chocolate bar 不能切成 k 部分,则输出-1.注意,每一刀需要符合3个条件:1.打横切或者打竖切: 2.每一刀只能经过unit square(即1*1的单元bar)的边,也就是说不能把一个单元bar损坏,要完…
http://codeforces.com/contest/450/problem/C 题意:一个n×m的矩形,然后可以通过横着切竖着切,求切完k次之后最小矩形面积的最大值. 思路:设k1为横着切的次数,k2为竖着切的次数,最后的面积的大小为s=n/(k1+1)*(m/(k2+1)); 只有(k1+1)*(k2+1)的最小时,s最大. #include <cstdio> #include <iostream> #include <cstring> #include &l…
//area=(n*m)/ ((x+1)*(k-x+1)) //1: x==0; //2: x=n-1 //3: x=m-1 # include <stdio.h> long long max(long long x,long long y) { return x>y? x:y; } int main() { long long n,m,k,sum,t,ans; scanf("%lld%lld%lld",&n,&m,&k); sum=n+m-2…
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 设最后行分成了x行,列分成了y列. 那么答案就是floor(n/x)floor(n/y) 然后x+y-2=k //即平均分配x行.y列 我们可以枚举floor(n/x)的值 这个值其实就是n整除x 我们现在证明n/x的结果最多只可能有2sqrt(n)个 证明: 当x小于\(\sqrt{n}\)时,n/x的值有\(\sqrt{n}\)个. 当x大于\(\sqrt{n}\)时,n/x的结果肯定小于\(\sqrt{n}\),因此也只可能有\(\…
B. Chocolate 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co Bob loves everything sweet. His favorite chocolate bar consists of pieces, each piece may contain a nut. Bob wants to break the bar of chocolate into multiple pieces…