aropan's blog

By aropan, 8 years ago, translation, In English,
 
 
 
 
  • Vote: I like it
  • +25
  • Vote: I do not like it

»
8 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

It's over!

Does anyone have a nice solution for #2, Auction?
I could only find an inelegant O(nlogn) solution, where n is 107.
  • »
    »
    8 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Many people talk about it in russian, but there is no good solutions at this moment. Some people have O(n) solutions as i know, with using minimum query for sufixes and/or prefixes, instead of [L, R] queries.

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Please someone check this code and tell me why is this wrong.I thought that once we got a tick it means that I am correct otherwise I would not have wasted those 5 and a half minutes.
  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    you forget 20 ~ 'U'. Why do you use numbers? char c = 'A' + i; if (c == 'H' || c == 'A' || .. etc. 
    • »
      »
      »
      8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Oh.Yes and thanks for the tip....Silly mistake:(
»
8 years ago, # |
  Vote: I like it +4 Vote: I do not like it