VPlanet Course 1: Implementation Unofficial editorial

Revision en2, by LemonMonster, 2021-04-02 22:15:05

Introduction

The contest can be found here
This is an unofficial editorial and I am no way associated to Vplanet!
. Also this is my first day at code forces and my first ever blog on first code forces , and I have tried to replicate many editorial blogs as far as possible, but if I have made any mistake , please do let me know :D

Problem A Key Races

So How do we calculate the time taken by a person. The person takes v seconds to type a character. And he is supposed to type s characters. He also faces a lag of t seconds 2 times , In the beginning while loading and second time when the site gets his data. So the formula to calculate the time would be:
Time = (v*s)+(2*t)
So now we can calculate the time by both participants and compare thus printing the output accordingly

Solution

____________________________________________________________________________________

Problem B — Fafa and the Gates

Lets plot the x=y graph and check how it looks like

Now we will notice that the person will be in the first kingdom if the x cordinate is greater than the y cordinate and is in the second kingdom when x cordinate is greater than y. So you can make a vector of at a time where the person is ie. kingdom 1 or kingdom 2. Tehn you can check the number of times he changes from one to two or vice versa.

Solution

____________________________________________________________________________________

Problem C — Bark to Unlock

So the dog will obviously unlock if he speaks that exact same word, so that can be a preliminary test. Also we notice that the password has only letters . So we can traverse through the words the enemy can speak and check if the first letter of the password is the last letter of one of the word the enemy can speak and if the last letter of the password is the first letter of one of the word , so he can speak these words simultaneously and pronounce the word. Also as we notice in the third testcase how speaking the word reverse it . So check if the enemy can speak the reverse word as well.

Solution

____________________________________________________________________________________

D. Race Against Time

In this problem fuirst we need to mark all the positoon of the hands. then from the current time we can either go back or front , If in this process we meet any hand , then we cannot use that method. So if either up is possible or down is possible , print Yes or print No

Solution
Tags #editorial, #vplanet

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English LemonMonster 2021-04-02 22:15:05 9
en1 English LemonMonster 2021-04-02 22:14:04 10282 Initial revision (published)