Ladies' Choice Teenagers from the local high school have asked you to help them with the organization of next year'sProm. The idea is to find a suitable date for everyone in the class in a fair and civilized way. So,they have organized a web site whe…
Period Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 11356 Accepted: 5279 Description For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the…
A Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyone around a circular table. First, everyone has converted all of their properties to coins of equal value, such that the total number of coins is di…