Spaceship
u too? [Link]/career
#WeLoveSoftware
#WeLoveSoftware
u too? [Link]/career
In 2048…
… humanity started mining rare minerals from the vast asteroid
belt situated between Mars and Jupiter, to fuel even more ambitious
engineering projects. To accomplish this, fleets of autonomous
spaceships were deployed, tirelessly shuttling precious resources
from asteroid mining sites back to an advanced space station
nearby.
Ensuring a safe return requires not just sophisticated technology,
but also ingenious algorithms capable of plotting routes through the
most treacherous environment known to humankind.
Level 1
u too? [Link]/career
#WeLoveSoftware
LEVEL 1
#WeLoveSoftware
u too? [Link]/career
LEVEL 1
This contest is about steering
a spaceship. The movement of a
spaceship is described using pace.
My average pace
is 5 minutes
per kilometer
Contrary to velocity, pace is time
divided by distance.
▪ You are given a list of movement sequences of a spaceship
▪ A movement sequence is a list of paces
▪ A pace is represented by an integer
− "5" takes 5 units of time and moves 1 unit of space
− "4" takes 4 units of time and moves 1 unit of space
▪ For each sequence, calculate the time it takes to complete
▪ All integers will be greater than 0
LEVEL 1
LEVEL 1
Input
Name Description Example
N Number of sequences 3
5 5
Sequence 5 4 4 4 5
A list of integers separated by spaces, each representing a pace 5 4 3 2 3 4 5
(repeated N times)
Output
Name Description Example
10
22
Time 26
The time it takes the sequence to complete
(repeated N times)
For each input file, calculate the output and write it in a file.
Upload your output file to the coding contest platform.
Good Luck!
u too? [Link]/career
#WeLoveSoftware
#WeLoveSoftware
u too? [Link]/career