LemonMonster's blog

By LemonMonster, 13 days ago, In English

Spoilers are broken! Sorry for the inconvenience!

Introduction

The contest can be found here
This is an unofficial editorial and I am no way associated to Vplanet!
. Also this is my second 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 Arya and Bran

We notice that the maximum amount of candies that we can give is 8 the rest of the candies are carry forward to the next day
So more formally , the tofees given on day i is min(arr[i],8)
and the number of candies carry forward are max(0,arr[i]-8).

Solution

____________________________________________________________________________________

Problem B Love Triangle

For this problem we can directly check that there is a triangle formed , by the numbers written on the array and then print the answer accordingly

Solution

____________________________________________________________________________________

Problem C — Chess for three

So for this problme we need to know the following details , the person who is watching , and the players who are playing , if the winner is the spectator at any point of time then the game is not possible or else its possible.

Solution

____________________________________________________________________________________

D. Fafa and his Company

We can run a loop from the 1 to the number given and check if (number-i)%i == 0 as it is the only way that all the leaders have same number of people working under them.

Solution

____________________________________________________________________________________

E. Restaurant Tables

In this problem we can take in input and check if the person is 2 seater or one seater , then if a person is two seater then we check if we have a two seater left , else we disappoint 2 customers. If its a one seater and we donot have a 1 seater left but we have a 2 seater left ,then we can put the one person there are increase the count of one seater as now anathor one person can sit with him

Solution

____________________________________________________________________________________

F. Between the Offices

We can see the number of times the person moves from S to F and from F to S and then depending depending on the cound check if we have to print no or yes

Solution
 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it