CodeForces 678C Joty and Chocolate】的更多相关文章

C. Joty and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Joty has got a task to do. She has a line of n tiles indexed from 1 to n. She has to paint them in a strange pat…
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<queue> #include<map> #include<stack> using namespace std; long long n,a,b,p,q; long long gcd(long long a,…
题目链接: C. Joty and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Joty has got a task to do. She has a line of n tiles indexed from 1 to n. She has to paint them in a stran…
C. Joty and Chocolate 题目连接: http://www.codeforces.com/contest/678/problem/C Description Little Joty has got a task to do. She has a line of n tiles indexed from 1 to n. She has to paint them in a strange pattern. An unpainted tile should be painted R…
E. Chocolate Bar Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/598/problem/E Description You have a rectangular chocolate bar consisting of n × m single squares. You want to eat exactly k squares, so you may need to break…
题目链接:http://codeforces.com/contest/598/problem/E E. Chocolate Bar time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have a rectangular chocolate bar consisting of n × m single squares. Y…
C. Mike and Chocolate Thieves time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Bad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible! As…
题目链接: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损坏,要完…
Mike and Chocolate Thieves 题目链接: http://acm.hust.edu.cn/vjudge/contest/121333#problem/G Description Bad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible! Aside from loving sweet things, thieves fr…
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…