Question: IN PYTHON PROGRAMMNG LANGUAGE!!! IN PYTHON PROGRAMMNG LANGUAGE!!! IN PYTHON PROGRAMMNG LANGUAGE!!! Thank you! An Interesting Game Alice and Bob are playing an interesting game,


IN PYTHON PROGRAMMNG LANGUAGE!!!
IN PYTHON PROGRAMMNG LANGUAGE!!!
IN PYTHON PROGRAMMNG LANGUAGE!!!
Thank you!
An Interesting Game Alice and Bob are playing an interesting game, which is described as follows. The game has n rounds. In the ith round, Alice and Bob act as follows. 1. Alice says an integer os. 2. Ifi > 2, then Bob finds a number B; {01.02. ... .0;-1} that is nearest to ai, and compute their distance A; = 1Bi-oil. 3. If i > 2, then Alice gets A; points, and Bob gets -Apoints. Given the sequence of numbers Alice says in this game, you are asked to compute the total points Alice can get. Input Format The first line contains a positive integer n. The second line contains n integers a1,..., are the numbers that Alice says in the game. which Output Format Output the total points Alice can get in the game. Limits 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
