Guess the Data Structure Analysis --------------------------------- The file size doesn't exceed 1 MB, so there are a maximum of about 1000/3 cases of size n = 1000. This is because each line of a case is 3 bytes. (Slightly more since 1 MB is 2 to the 20th, not 1,000,000.) In the case with n = 1000, in the worst case, we have at most 500 delete operations. The run time of these would be roughly 500 + 499 + ... + 1 = 125,250 simple operations. Times 350 (slightly higher for safety) cases that's 350 x 125,250 = about 44 million, which could easily run in one second. If we increase the bound on n = 300,000, allowing for a single input case of this size, then an O(n) delete min would result in roughly 150000*150001/2, or about 10 billion simple operations which can NOT run fast enough. But, with a priority queue, these operations would take roughly 150000*lg(150000) which is no more than 2.7 million simple operations, which should run easily in the time limit provided.