POJ 1731 Orders
来源:互联网 发布:新浪财经数据价格 编辑:程序博客网 时间:2024/06/05 13:27
Orders
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11122 Accepted: 6648
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 are stored in the same warehouse (i.e. in the same building) labelled with this letter. During the day the stores manager receives and books the orders of goods which are to be delivered from the store. Each order requires only one kind of goods. The stores manager processes the requests in the order of their booking.
You know in advance all the orders which will have to be processed by the stores manager today, but you do not know their booking order. Compute all possible ways of the visits of warehouses for the stores manager to settle all the demands piece after piece during the day.
You know in advance all the orders which will have to be processed by the stores manager today, but you do not know their booking order. Compute all possible ways of the visits of warehouses for the stores manager to settle all the demands piece after piece during the day.
Input
Input contains a single line with all labels of the requested goods (in random order). Each kind of goods is represented by the starting letter of its label. Only small letters of the English alphabet are used. The number of orders doesn't exceed 200.
Output
Output will contain all possible orderings in which the stores manager may visit his warehouses. Every warehouse is represented by a single small letter of the English alphabet -- the starting letter of the label of the goods. Each ordering of warehouses is written in the output file only once on a separate line and all the lines containing orderings have to be sorted in an alphabetical order (see the example). No output will exceed 2 megabytes.
Sample Input
bbjd
Sample Output
bbdjbbjdbdbjbdjbbjbdbjdbdbbjdbjbdjbbjbbdjbdbjdbb
Source
CEOI 1999
题目大意:求给你的字符串的全排列
#include<iostream>#include<algorithm>#include<string>using namespace std;int main(){string str;while(cin>>str){sort(str.begin(),str.end());do{cout<<str<<endl;}while(next_permutation(str.begin(),str.end()));} }
阅读全文
0 0
- 1731 Orders POJ
- poj 1731 Orders
- POJ 1731 Orders
- poj 1731 orders
- POJ 1731 Orders
- POJ-1731-Orders
- poj 1731 Orders
- POJ-1731-Orders
- poj 1731 Orders
- POJ - 1731 Orders
- POJ 1731 Orders 【STL】
- POJ 1731 Orders
- POJ 1731 Orders
- POJ 1731 Orders
- poj 1731 Orders
- poj 1731 Orders
- poj 1731 Orders
- POJ 1731 Orders
- stm32 堆和栈
- 在 SSM 中使用 Ajax 进行数据传递
- javascript中 if(!-[1,])是什么意思呀?
- Elasticsearch 5.x 基本概念
- GOJ 1096
- POJ 1731 Orders
- ES 和influxdb那些事
- 关于hovers
- 数据库三大范式详解
- 线程管理
- hdu 3507 Print Article
- Java 数据结构_线性表
- java中的垃圾回收机制及内存泄漏的现象
- python基础(基础语法)