I am new in SPOJ. How time is counted??? Is it compiling time or anything else.. Please give some tips to reduce the compilation time.[/b]
created
last reply
- 7
replies
- 310
views
- 4
users
I am new in SPOJ. How time is counted??? Is it compiling time or anything else.. Please give some tips to reduce the compilation time.[/b]
......
qsort(N,n,sizeof(int),comp);
qsort(M,n,sizeof(int),comp);
.....
}
....
sort(AB.begin(), AB.end());
sort(CD.begin(), CD.end());
....
Above are two codes for the SUMFOUR problem..my question is that why the first code gets a tle ..while second code runs in time.
The basic structure and program flow is same in both cases.
I posted it in this section as i think its is due to some bad programming practice.
I would also like to add that the first code may give an stack overflow ...so declaration as global will work fine..i have tested that code also ..it also gives a tle.
Thanks
**code was edited after clarification by swarnprakash only significant part was not deleted , Thanks
Topic | Category | Replies | Views | Activity |
---|---|---|---|---|
SPTTRN1 - Straight Line Spiral Pattern (Act 1) | C and C++ | 0 | 35 | 26d |