Блог пользователя sentinel45

Автор sentinel45, 12 лет назад, По-английски

getting WA constantlyy.....

165C - Another Problem on Strings

i've now tried every way to get the correct answer to ths prob...

initialy ws getting TLE thn i optimized my code...

pre is the vector holding number of 1's encountered till i...

memo is counting the ferquency of ths number of 1's...

my code is here...

1824256

plz help...or suggest smthng i shud keep in mind further...

thanx

  • Проголосовать: нравится
  • -26
  • Проголосовать: не нравится

»
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

That's because you are using long long for count, but long for memo, when you declare memo as long long you will got AC ;-)

  • »
    »
    12 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    yeahh...

    after a few hours of posting ths blog i figured it out...

    and it was btr to type cast the memo[pre[i]] to long longprior to multiplication...than changing the declaration to long long.. (i tried both ways...:P)

    but seeing no reactions...i didnt update the blog...

    thnx fr yr response....though, i cannot understand y i got so mny downvotes....:(