The round is starting in around half an hour. Let's discuss the approaches here after it's done.

Good luck!

# | User | Rating |
---|---|---|

1 | tourist | 3565 |

2 | Benq | 3540 |

3 | Petr | 3519 |

4 | maroonrk | 3503 |

5 | jiangly | 3391 |

6 | ecnerwala | 3363 |

7 | Radewoosh | 3349 |

8 | scott_wu | 3313 |

9 | ainta | 3298 |

10 | boboniu | 3289 |

# | User | Contrib. |
---|---|---|

1 | 1-gon | 199 |

2 | Errichto | 196 |

3 | rng_58 | 194 |

4 | SecondThread | 186 |

4 | awoo | 186 |

6 | Um_nik | 182 |

7 | vovuh | 178 |

8 | Ashishgup | 176 |

9 | -is-this-fft- | 173 |

9 | antontrygubO_o | 173 |

The round is starting in around half an hour. Let's discuss the approaches here after it's done.

Good luck!

The above image is a problem from a recent hiring test by CodeNation. Any clues on how to solve it?

P.S. This test is over, it's been a couple days now

I am trying to solve problem 1136E, where I need to find the lowest $$$pos$$$ such that $$$b_{pos} \geq b_i + x$$$. I generally use the lazy segment tree from the AtCoder Library, which is iterative. In a recursive segment tree, I could just move down the tree choosing the left or right node. How do I do this in an iterative segment tree?

```
int find_pos(int val)
{
int root = 1;
while (root < size)
{
push(root);
int l = 2*root;
int r = 2*root+1;
if (t[l].mx >= val)
root = l;
else
root = r;
}
return root-size;
}
```

This gives the wrong lower bound on some cases. I think it's because in the iterative case, it is not a clear tree, but rather a set of binary trees. Usually we move bottom up when calculating in an iterative segtree, so either it is not possible in an iterative segtree (without magic) or I have misunderstood something. Please let me know.

I was reading the editorial for 1136D, and solution 2 talks about a graph-based solution. I didn't completely understand it. I understood the graph they built(I think), and the answer is the number of unreachable vertices, but what is this "standard algorithm" called DFS by complement graph? I've never heard of it, and I just see a bunch of papers on Googling, which leads me to believe it isn't as standard as the editorialist claims it is. Also, if this is the standard definition of a complement graph, why is the graph described in the problem the complement of the provided graph? Is it assuming I remove all the edges where $$$v$$$ is behind $$$u$$$?

I've posted this blog since comments about the same on the editorial went ignored, so I hope this will reach more people. Thanks in advance.

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/04/2021 00:47:14 (i2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|