STACKS - new to codechef compiler

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t=100;
	cin>>t;
	while(t--){
	    int n=100;
	    cin>>n;
	    vector<int> r(n);
	    for(int i=0;i<n;i++){
	        cin>>r[i];
	    }
	    vector<int> pq;
	     int num_stacks=0;
	    for(int i=0;i<n;i++){
	       if(num_stacks==0 || pq[num_stacks-1]<=r[i]){
	           pq.push_back(r[i]);
	           num_stacks++;
	       }
	       else{
	           vector<int>::iterator lb=lower_bound(pq.begin(),pq.end(),r[i]);
	           pq[lb-pq.begin()]=r[i];
	         
	       }
	    }
	    cout<<num_stacks<<" ";
	    for(int i=0;i<num_stacks;i++){
	        cout<<pq[i]<<" ";
	    }
	    cout<<endl;
	}
	return 0;
}

cin statements are getting ignored for some reason in codechef for some reason, it works fine if i run it for custom input.