Layout
Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 8651 | Accepted: 4165 |
Description
Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The cows are standing in the same order as they are numbered, and since they can be rather pushy, it is possible th