标签:logs eof iostream space namespace include out main cout
1 //认真读题啊。。。。。。。。god。。。。 2 #include<iostream> 3 #include<cstring> 4 using namespace std; 5 6 int ans; 7 int v[3005]; 8 9 void solve(int x) 10 { 11 int i; 12 for(i=0; i<=ans; ++i) 13 if(v[i] >= x) 14 { 15 v[i] = x; 16 break; 17 } 18 if(i == ans+1) 19 v[ans++] = x; 20 } 21 22 int main() 23 { 24 int n,x; 25 while(cin >> n && n!=-1) 26 { 27 ans = 0; 28 memset(v,0,sizeof v); 29 while(n--) 30 { 31 cin >> x; 32 solve(x); 33 } 34 cout << ans << endl; 35 } 36 }
标签:logs eof iostream space namespace include out main cout
原文地址:http://www.cnblogs.com/qq188380780/p/6651508.html