题目链接:http://poj.org/problem?id=2363 思路分析:由于数据较小,采用暴力搜索法.假设对于矩形边长 1 <= a <= b <= c <= N; 由于 c = N / (a * b), c必须满足条件:为整数且不小于b. 代码如下: #include <iostream> using namespace std; int main() { int n, min_area; double a, b, c, volume; cin >&…
Blocks Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3997 Accepted: 1775 Description Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of paint…
题目链接:http://poj.org/problem?id=1731 思路分析:含有重复元素的全排列问题:元素个数为200个,采用暴力枚举法. 代码如下: #include <iostream> #include <algorithm> using namespace std; + ; void PrintPermu( int n, char P[], char A[], int cur ) { int i, j; if ( cur == n ) { ; i < n; ++…
Blocks Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 4250 Accepted: 1704 Description Some of you may have played a game called 'Blocks'. There are n blocks in a row, each box has a color. Here is an example: Gold, Silver, Silver, Sil…