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

Автор Kaneki_04, история, 7 лет назад, По-английски

I had an assignment involving multi-threading and I was curious about what happens if I implement this here.

So, I ran this code to check if it was possible to reduce execution time.

At an input of N around 7*10^4 2 and 5 threads gave 6162ms while 9 threads gave 3478ms.

So by this logic isn't it possible to implement some brute force solutions via multi-threading?

This would defeat the purpose of competitive programming right?(It is certainly not efficient but someone can submit a brute force solution and get their solution accepted but one who couldn't think of an optimum method ends up losing points)

Edit:

Test 1

Test 2

Полный текст и комментарии »

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

Автор Kaneki_04, история, 7 лет назад, По-английски

I have been trying to improve my knowledge on data structures and I started off with this blog.

I found the question mentioned in the blog quite interesting and was wondering if there were any other questions based on partial sums on codeforces..

Any help would be highly appreciated.

Thanks!!

Полный текст и комментарии »

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

Автор Kaneki_04, история, 7 лет назад, По-английски

Can someone tell me why custom test shows right answer but I WA??

Submission : 30314885

Link to image : Custom test

Полный текст и комментарии »

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

Автор Kaneki_04, история, 7 лет назад, По-английски

I was thinking of a way to solve this problem in O(1) and I am not getting the right answer..

My logic was that..

the answer is (a+b)(a+1)(b+1)/2 and the equation is x+my=mc(I changed b to c for convinience..)

so upon applying the am>=gm inequality in the following way..

((a+b)+(a+1)+(2*m-1)(b+1)/3>=((2*m-1)^1/3)*answer

so answer would be floor(LHS/(2*m-1)^1/3) and LHS is (2*m*c+2*m)/3 as (a,b) lies on the line..

but I was getting a wrong answer..

Sorry if I missed something obvious and any help would be really appreciated..

Полный текст и комментарии »

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