poj 1731
来源:互联网 发布:球体运动js效果大全 编辑:程序博客网 时间:2024/05/29 16:04
Orders
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6638 Accepted: 4187
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
分析:此题求不同全排列,按字典顺序输出
我的算法:先将输入串按字母排序,然后给每个字符开一个指针,指向下一个字母,每次从左到右取字符,去掉的把指向它的指针指 向它指的字符,记录所取字符,直到取了n个后输出。。。感觉这样应该是最快的方法吧,但是我的怎么还要16ms,⊙﹏⊙b汗,难 道我又写挫了,求神牛指教
很挫的代码:
- poj 1731
- poj 1731
- 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
- Creating your first Windows Phone (WM 6.5) application
- Makefile指定编译选项
- eclipse 中的注释 快捷键
- ARP 欺骗
- 人人网移动开发架构
- poj 1731
- 调用 ICTCLAS5 分词的一点问题
- AcstionScript位图保存技术及相关内存优化
- 【总结】获取内核ntoskrnl.exe基地址的几种常见办法
- 怎样修改Eclipse注释的作者
- GridView+DropDownList+TextBox实现查询功能
- Js 数据去掉小数点后边的0
- 存储过程学习日记
- 程序员的打油诗