C programming
#include #include #include
using namespace std;
int main(){ int init_data; int cnt=0; while(cin>>init_data && init_data!=-1){ if(cnt) cout<<endl; cnt++; vector h,m; h.push_back(init_data); m.push_back(1); int data; while(cin>>data && data!=-1){ int max=0; for(int i=h.size()-1;i>=0;i–){ if(h[i]>=data){ if(m[i]>max) max=m[i]; } } m.push_back(max+1); h.push_back(data); } cout<<”Test #”<<cnt<<’:'<<endl <<” maximum possible interceptions: “<<*max_element(m.begin(),m.end())<<endl; } cout<<endl; }
I need C# programming code.
Can u please tell me the way to take input for acm-icpc problems?? Is it from a file or arguments or what???
would u please tell me which books are good for beginers
Name (required)
E-mail (will not be published) (required)
Website
Notify me of follow-up comments via email.
#include
#include
#include
using namespace std;
int main(){
int init_data;
int cnt=0;
while(cin>>init_data && init_data!=-1){
if(cnt) cout<<endl;
cnt++;
vector h,m;
h.push_back(init_data);
m.push_back(1);
int data;
while(cin>>data && data!=-1){
int max=0;
for(int i=h.size()-1;i>=0;i–){
if(h[i]>=data){
if(m[i]>max) max=m[i];
}
}
m.push_back(max+1);
h.push_back(data);
}
cout<<”Test #”<<cnt<<’:'<<endl <<” maximum possible interceptions: “<<*max_element(m.begin(),m.end())<<endl;
}
cout<<endl;
}
I need C# programming code.
Can u please tell me the way to take input for acm-icpc problems?? Is it from a file or arguments or what???
would u please tell me which books are good for beginers