시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 42 | 23 | 22 | 70.968% |
You are at the fitness centre to run through your exercise programme. You must use the kinds of exercise machine in an order precisely dictated by the programme, although there may be more than one instance of a machine.
You start at the centre of a unit circle around which the exercise stations are arranged. You can walk directly between any two points in the circle, and you may also visit the same point multiple times. See Figure J.1 below for an example.
Figure J.1: Illustration of Sample Input 1. Types of machine: [1, 2, 4, 1, 3, 2]
Exercise is an important and noble endeavour, but in today’s busy world we must strive for efficiency in everything we do. Find the most efficient way of visiting exercise stations that matches the order given.
Output the minimum distance you will need to walk. Your answer must be accurate to an absolute or relative error of 10−6.
6 1 2 4 1 3 2 5 1 4 2 2 3
7.604395
5 4 2 1 3 1 6 1 2 1 3 1 4
5.732051
ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2019 J번