Vector v; int i=0; while(i!=999) { cin>>i; v.push_back(i); }
Time taken by this piece of code could vary when the number of inputs vary. Since vector would take amortized time for new allocation. Even for same size the program at different times could take different time.
Suggest changes (e.g. use list instead of vector), which makes the time a function of number of inputs.