传送门:http://poj.org/problem?id=3617
Best Cow Line
Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 23932 | Accepted: 6498 |
Description
FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.
The contest organizers adopted a new registration scheme this year: simply register the initial letter of every cow in the order they will appear (i.e., If FJ takes Bessie, Sylvia, and Dora in that order he just registers BSD). After the registration