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

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

how to solve discrete logarithm over composite modulus, i know over prime modulo using Baby-step giant-step algorithm, but in case of composite modulus i have no idea how to solve this. i think this can be done by factorization of modulo and chinese remainder theorem but i don't know how to do this.

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

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

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

Given a cost matrix (may contain negative values) and a man has some non-negative initial strength, he starts from zero(start) position and complete his journey at (n-1)th position with some non-negative power. matrix[i][j]>0 denotes he lost his strength from moving city i to j and matrix[i][j]<0 denotes he gain his strength by matrix[i][j]. he has to cover all the cities from 1 to n-2 and during his journey path his power may become negative but at the (n-1)th pos(destination) his power must be non-negative. we have to find whether he able to complete his journey or not.

test case-

         initial strength=1
         cost matrix = [0 2 2 -1]
                       [4 0 2 -1]
                       [4 2 0 -1]
                       [4 2 2 0]
         ans=YES 
         path is- 
         (0 -> 3 -> 1 -> 3 -> 2 -> 3)
         strength during its journey
         (1 -> 2 -> 0 -> 1 -> -1 ->0)

i have no idea how to solve this question please help.

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

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

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

how to prove space complexity in segment tree is O(4*n).

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

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

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

is there is a way to find out the total memory being consumed by my c++ program. is there is any tool or library by which i can find memory being consumed by my program.

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

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