Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
why WA? thx#include <cstdio> #include <algorithm> #include <functional> using namespace std; int n, h, a[80000], res = 0; int* e = a; int main() { scanf("%d", &n); while (n--) { scanf("%d", &h); e = lower_bound(a, e, h, greater<int>()); res += e - a; *e++ = h; } printf("%d\n", res); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator