URI – Warm up Contest to OBI 2016 -second phase

Hey there,

Not so recently happened the Warm up Contest to OBI 2016 and I was one of the authors again (I was one of the authors in the first phase as well)!

I wrote 1 problem: Rio 2016
I’ll make a fast editorial of this problem and, hopefully, this will help someone :)!

Rio 2016

By: Marianne Linhares

This problem is very up forward, reading the problem carefully is easy to see that we should calculate the distance between the points and then compare it with the time that the match will begin.

Buuuut, be careful with the use of integers, the multiplication may not fit in an integer, so you should use long long int (C++) for the position variables.

A C++ solution can be seen here.

  • Complexity: O(n).
URI – Warm up Contest to OBI 2016 -second phase