I have not been able to solve this problem.Can any tell me how to solve it.The best i can think is of djikstra,but that will obviously give me time limit exceeded.Can anyone tell me the solution.

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

1 | Benq | 3650 |

2 | Radewoosh | 3648 |

3 | tourist | 3579 |

4 | ecnerwala | 3551 |

5 | Um_nik | 3494 |

6 | Petr | 3452 |

7 | ksun48 | 3432 |

8 | jiangly | 3349 |

9 | maroonrk | 3338 |

10 | Miracle03 | 3314 |

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

1 | 1-gon | 211 |

2 | awoo | 188 |

3 | rng_58 | 185 |

3 | Errichto | 185 |

5 | SecondThread | 182 |

6 | Um_nik | 176 |

7 | Ashishgup | 175 |

8 | maroonrk | 174 |

9 | antontrygubO_o | 170 |

10 | -is-this-fft- | 169 |

I have not been able to solve this problem.Can any tell me how to solve it.The best i can think is of djikstra,but that will obviously give me time limit exceeded.Can anyone tell me the solution.

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/19/2021 00:48:16 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

You can use binary search. Then for fixed answer X you may check it in O(N+M) — bfs over modified graph with states

[vertice of original graph][number of edges with weight >X in path].I didn't get the modified graph part.Can you please ellaborate.

We are interested in weight of second heaviest edge on the path. If we'll use binary search — then question is modified to

can we find a way from start to finish with second heaviest edge of weight no more than X, and this one is equal tocan we find a way from start to finish wish <=1 edges of weight more than X in it.And now it is clear that you are interested only in your current vertex and number of used "heavy" edges (because you can't use "heavy" edge if you used 1 before — then you'll have 2 "heavy" edges in your path).

How to solve problem L :) http://codeforces.com/gym/100460/problem/L Thanks in advance :)

Looks like we can find for each man the interval of possible relation (from any event we know that for any man realtion <=x) and then check for each event that exists man who took part in it and can have realtion equal to event's relation.

thanks you :)

why i can't solve it by find for each man the smallest event he took part in it and check that there is no event i know all his members values and the relation of that event not match any of its members for(int k = 0; k < event.size();k++) if(elementsmxs[event[k]] == event_value){ ff = true; break; }

This is my early solution https://ideone.com/c2WYjz. I use queue to calculate the events with only person and update the events that person take part in. But I get WA on test 23. When I remove queue, I get AC but I don’t know why. Can someone explain for me? Thanks. (Sorry for my bad English).

https://codeforces.com/gym/100460/problem/H

How can i solve this problem i tried a lot but i get wa4