Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

Tatyana.tu96 avatar Tatyana.tu96 0 Точки

SoftUni Reception

Някой може ли да ми помогне защо ми дава 50/100 в Judge. 

https://pastebin.com/SM9LqdN1

 

Three employees are working on the reception all day. Each of them can handle a different number of students per hour. Your task is to calculate how much time it will take to answer all the questions of a given number of students.

First, you will receive 3 lines with integers, representing the number of students that each employee can help per hour. On the following line, you will receive students count as a single integer.

Every fourth hour, all employees have a break, so they don't work for an hour. It is the only break for the employees, because they don't need rest, nor have a personal life. Calculate the time needed to answer all the student's questions and print it in the following format: "Time needed: {time}h."

Input / Constraints

  • On the first three lines -  each employee efficiency -  integer in the range [1 - 100]
  • On the fourth line - students count – integer in the range [0 – 10000]
  • Input will always be valid and in the range specified

Output

  • Print a single line: "Time needed: {time}h."
  • Allowed working time / memory: 100ms / 16MB
Тагове:
0
Python Fundamentals
janeta.chudomirova avatar janeta.chudomirova 3 Точки

Колега, ето едно решение на C#, ако може да ти е от полза:

int studentsForFirstEmploye = int.Parse(Console.ReadLine());
int studentsForSecondEmploye = int.Parse(Console.ReadLine());
int studentsForThirdEmploye = int.Parse(Console.ReadLine());
int studentsCount = int.Parse(Console.ReadLine());

int time = 0;
int sumStudentsForHour = studentsForFirstEmploye + studentsForSecondEmploye + studentsForThirdEmploye;


while (studentsCount > 0)
{
    time++;

    if (time % 4 == 0)
    {
        continue;
    }

    studentsCount -= sumStudentsForHour;
}

Console.WriteLine($"Time needed: {time}h.");

2
17/02/2023 13:11:16
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.