fork(2) download
#include 
#include 
#include 
#include 

using namespace std;

int main() {
  istream_iterator eos;
  istream_iterator iit (cin);
  vector seq;
  copy(iit, eos, back_inserter(seq));

  int len = 1, pos = 0, maxlen = 1, current_start = 0;
  for (int i = 1 ; i < seq.size() ; i++) {
    if (seq[i] > seq[i-1]) {
      len++;
      if (len > maxlen) {
        maxlen = len;
        pos = current_start;
      }
    } else {
      len = 1;
      current_start = i;
    }
  }

  for (int i = pos ; i != seq.size() && (i == pos || seq[i] > seq[i-1]) ; i++) {
    cout << seq[i] << " ";
  }
  cout << endl;
}
Success #stdin #stdout 0.01s 2816KB
stdin
2 4 1 7 4 5 0 8 65 4 2 34
stdout
0 8 65