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

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

How could i optimize my solution ? here is my submission 41328050 ? Please help me :) Problem link Thanks in advance :)

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

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

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

Problem Link Anyone please help me to understand the problem . For this example :

       3 3
       3 1
       2 1
       2 3

If we set label[ 2 ] = 1 , label[ 3 ] = 2 , label[ 1 ] = 3 ; Answer should be : 2 3 1 but answer is 3 2 1 , but why ?

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

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

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

I'm getting TLE again & again for this problem . here is my solution . Please help me how would i optimize my approach ?

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

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

Автор Ehsan_sShuvo, история, 6 лет назад, По-английски
  • Проголосовать: нравится
  • -4
  • Проголосовать: не нравится

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

In Vanya and Exams problem ,minimum of min(avg * n - sum, r - ai) will be added to the answer . But why do we subtract ( r — ai ) ? Anyone else please help me .


Thanks in advance

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

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

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

My Submission for the problem Blocking.Here,i have used Stable Marriage ALgorithm.But i got WA & WA.Please,anyone help me..

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

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

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

Need a list of problems on Bitmask from novice to medium hard..I am a beginner. Thanks in advance :)

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

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

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

How could i solve this problem.Please help me to solve this problem. Thanks in advance :)

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

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

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

Here is two implementation of this problem

Using Sparse Table: Submission Using Segment Tree: Submission

Time took by Sparse Table is 0.336 s ,where Segment Tree took 0.324 s. Memory took by Sparse Table is 8732 KB ,where Segment Tree took 3640 KB.

Problem is static,thats why Sparse Table should be fast!But here i couldn't see this..Where is the problem?Could anyone please find that out ?

Thanks in advance :)

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

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

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

I got Runtime Error!I have been trying to find out this fault for 4hours.But,i cant get my fault.Could anyone please help me where is my error? Code is here.If i got wrong answer,then i will check that out.But why i am getting Runtime Error? Problem Link is here probelm link

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

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

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

I am seeing this error for the first time in any judge.Can anybody have any idea what is it?oh!I have missed a point!CodeForces staus page today shows many judgement error! Thanks in advance!

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

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

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

Could anyone please explain me clearly why we have to do

low[vertex]=min(low[vertex],dis[i]);

Yeah!I know that is for lowest discovery time determination.But my question is that all the time we put minimum time in the current node comparing with its adjacent nodes,but not increase the time.My question is two or more nodes cant visit at a time.But lowest time show that,it can do that.But how? Could anyone please clear me out?Actually,i read more than 5/6 resources,but i couldn't get that.There all says about subtree,ancestor,blah blah,but my memory couldn't make a sense for that,what they actually want to say.

Thanks in advance.

Following is the psuedocode of finding out articulation point.

time = 0
function DFS(adj[][], disc[], low[], visited[], parent[], AP[], vertex, V)
        visited[vertex] = true
        disc[vertex] = low[vertex] = time+1
        child = 0
        for i = 0 to V
                if adj[vertex][i] == true
                        if visited[i] == false
                                child = child + 1
                                parent[i] = vertex
                                DFS(adj, disc, low, visited, parent, AP, i, n, time+1)
                                low[vertex] = minimum(low[vertex], low[i])
                                if parent[vertex] == nil and child > 1
                                        AP[vertex] = true
                                if parent[vertex] != nil and low[i] >= disc[vertex]
                                        AP[vertex] = true
                        else if parent[vertex] != i
                                low[vertex] = minimum(low[vertex], disc[i])

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

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

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

I have tried my level best to understand this problem.Could anyone else please explain me how i solve this problem?

Note: I know Binary Indexed tree and want to solve this problem by this algorithm.Google search couldn't make a sense for myself to solve this problem.Everywhere,i saw,sort query according to it's value 'k'.And suggestion was that sort your given array also..But,i failed to get that!Pure explanation needed!

Thanks in advance!

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

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

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

why in Z algorithm substring length is bound-1? please,explain this anyone.

Z[k] would be longest substring starting at k which is also prefix of the string. Now R-i + 1 gives the length of remaining characters in the Z box. Since we copy the value of Z[k] to optimize the calculation of Z values we need to check whether these values are inside the boundary of the Z box

Why not we calculate the remaining part including k index?K index is in the substring,so why skip this index?

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

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

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

277A - Learning Languages

I want to solve this problem by DSU.. But,unfortunately,i don't get that..i have already checked Tutorial,someone else code..but,till now,i'm in darkness It's an Bipartite graph base problem.But,what is happening here ? Anyone plz help me. Thanks in advance

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

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

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

Can anyone please help me to understand the "Segmented Seive"?I have tried myself as i can do enough to get it but unfortunately still now i don't catch it. Thanks in advance!

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

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

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

To practise more on Number Theory realted problem,is there any oj except spoj,uva where i'll get a catagorized problem? And want to know that which topics on Number theory should i konw for competitive programming?Let's help me by giving helpfull tutorial link.

Thanks!Thanks in advance ! Happy coding!

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

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