Data Structure Machine Test 1: Application of sequence table Time Limit: 1000 ms memory limit: 65536 k any questions? Click Here ^_^ In an ordered table with a length of n (n <1000), there may be "redundant" data elements with the same values (integer type ), write a program to delete "redundant" data elements from the ordered table, so that the table is composed of a "non-pure table" (elements with the same value may have multiple) to a "Pure table" (only one element with the same value can exist in the table ). The length of the input table in the first row is N;
In the second row, enter the N element values initially stored in the sequence table. Output the number of elements in the sequence table after the redundant elements are deleted in the first row;
The second row outputs the sequence table elements after deletion. Sample Input
125 2 5 3 3 4 2 5 5 4 3
Sample output
55 2 3 4 7
TIPS: use as little time as possible and the auxiliary storage space. I thought I would use a vector. I didn't expect to delete elements. (compared with list, I used to delete elements in list)