Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор FreeHit, история, 2 года назад, По-английски

I want to code A. Get together with approach by limiting value of f(t) ? but i cant get through it ? can i use sweep line algorithm.... after limiting value?and how to code it?here is link to question https://mirror.codeforces.com/edu/course/2/lesson/6/3/practice/contest/285083/problem/A

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

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

You can binary search on the answer, and maintain a segment that everyone can reach. If the segment is non-empty then the value is ok.

»
5 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

https://pastebin.com/FyrFZyUw <= my code

I am getting ans = 1.4 on

5 -1 5 10 3 4 2 7 10 8 1

but the ans is 1.5