Does anybody know if there will be Facebook Hackercup this year. Previous year it was announced till this time of January.

Before contest

Codeforces Round 940 (Div. 2) and CodeCraft-23

34:00:53

Register now »

Codeforces Round 940 (Div. 2) and CodeCraft-23

34:00:53

Register now »

*has extra registration

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

1 | ecnerwala | 3648 |

2 | Benq | 3580 |

3 | orzdevinwang | 3570 |

4 | cnnfls_csy | 3569 |

5 | Geothermal | 3568 |

6 | tourist | 3565 |

7 | maroonrk | 3530 |

8 | Radewoosh | 3520 |

9 | Um_nik | 3481 |

10 | jiangly | 3467 |

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

1 | maomao90 | 174 |

2 | awoo | 164 |

2 | adamant | 164 |

4 | TheScrasse | 159 |

4 | nor | 159 |

6 | maroonrk | 156 |

7 | -is-this-fft- | 150 |

8 | SecondThread | 147 |

9 | orz | 146 |

10 | pajenegod | 145 |

This is the Div1-250 level problem of SRM-683 :- There are n piles of stones arranged around a circle. The piles are numbered 0 through n-1, in order. In other words: For each valid i, piles i and i+1 are adjacent. Piles 0 and n-1 are also adjacent. You are given two vector s a and b, each with n elements. For each i, a[i] is the current number of stones in pile i, and b[i] is the desired number of stones for this pile. You want to move some stones to create the desired configuration. In each step you can take any single stone from any pile and move the stone to any adjacent pile. Find and return the smallest number of steps needed to create the desired configuration, or -1 if the desired distribution of stones cannot be reached.

In the editorial of the problem it is mentioned — "The solution to this cyclic version comes upon realizing that the stones don't need to move between more than n stacks, the moves in such a situation would be redundant. So there will be two adjacent stacks that don't need to share stones at all. Those two stacks can be used as the start and the end stacks of a solution like the division 2 version. "

My doubt is that how do we proof that in case of minimum moves, there will exist two adjacent piles such that no transfer of stones happens across their partition.

Thanks in advance :)

Hello everyone,

Is somebody else also facing issues with running codeforces on mozilla firefox. Even after scheduled maintenance, it is not working properly, there is a huge margin problem(everything has shifted left), and there is no navigation bar visible.

Thanks

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/20/2024 07:34:08 (j1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|