题目链接: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; ++…
http://poj.org/problem?id=1731 Orders Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9702 Accepted: 5925 Description The stores manager has sorted all kinds of goods in an alphabetical order of their labels. All the kinds having label…
The stores manager has sorted all kinds of goods in an alphabetical order of their labels. All the kinds having labels starting with the same letter are stored in the same warehouse (i.e. in the same building) labelled with this letter. During the da…
Orders Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9940 Accepted: 6048 Description The stores manager has sorted all kinds of goods in an alphabetical order of their labels. All the kinds having labels starting with the same letter…
题目链接: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 >&…
题目链接:http://poj.org/problem?id=2912 Time Limit: 5000MS Memory Limit: 65536K Description N children are playing Rochambeau (scissors-rock-cloth) game with you. One of them is the judge. The rest children are divided into three groups (it is possible t…
http://poj.org/problem?id=3414 记录瓶子状态,广度优先搜索即可 #include <cstdio> #include <cstring> #include <queue> using namespace std; const int maxn=101; int n,m; typedef unsigned long long ull; int A,B,C; int vis[maxn][maxn]; int ans[maxn][maxn][ma…