Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

SPOJ:SMCNT

Name: NULL 2012-03-15 14:24

Hi /prog/,
I'm trying to solve a challenge a friend gave me.
I have a huge list A[] (10^6 in length) of numbers, and for each k i have to print the number of A[k'] with: k' > k and A[k'] < A[k].
Example:
In: 12 5 7 3 0 1
Out: 5 3 3 2 0 0

I've thought about using a research binary tree or a red-black tree. Thoughts ?
(excuse my English, it's not my natural tongue.)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List