10. Rage Expenses
Хора, не разбиръм къде бъркам. Задачата се изпълнява коректно, коректно е и форматирането на Output - а. Отгворите са 1:1. Има изискване за време и RAM, което изпълнявам. Защо Judge ми дава 0/100???
Solution #13898721 by VesselinTonchev for problem 10. Rage Expenses
As a MOBA challenger player, Pesho has the bad habit to trash his PC when he loses a game and rage quits. His gaming setup consists of headset, mouse, keyboard and display. You will receive Pesho`s lost games count.
Every second lost game, Pesho trashes his headset.
Every third lost game, Pesho trashes his mouse.
When Pesho trashes both his mouse and headset in the same lost game, he also trashes his keyboard.
Every second time, when he trashes his keyboard, he also trashes his display.
You will receive the price of each item in his gaming setup. Calculate his rage expenses for renewing his gaming equipment.
Input / Constraints
• On the first input line - lost games count – integer in the range [0, 1000].
• On the second line – headset price - floating point number in range [0, 1000].
• On the third line – mouse price - floating point number in range [0, 1000].
• On the fourth line – keyboard price - floating point number in range [0, 1000].
• On the fifth line – display price - floating point number in range [0, 1000].
Output
• As output you must print Pesho`s total expenses: "Rage expenses: {expenses} lv."
• Allowed working time / memory: 100ms / 16MB.
Examples
Input Output Comment
7
2
3
4
5 Rage expenses: 16.00 lv. Trashed headset -> 3 times
Trashed mouse -> 2 times
Trashed keyboard -> 1 time
Total: 6 + 6 + 4 = 16.00 lv;
23
12.50
21.50
40
200 Rage expenses: 608.00 lv.
using System;
namespace Rage_Expenses
{
class Program
{
static void Main(string[] args)
{
//INPUT
int lostGames = int.Parse(Console.ReadLine());
double headsettPrice = double.Parse(Console.ReadLine());
double mousePrice = double.Parse(Console.ReadLine());
double keyboardPrice = double.Parse(Console.ReadLine());
double displayPrice = double.Parse(Console.ReadLine());
//VARIABLES
int counter = 0;
int headsetCount = 0;
int mouseCount = 0;
int keyboardCount = 0;
int displayCount = 0;
double totalPrice = 0;
for(int i = 0; i < lostGames; i++)
{
if (counter %2 == 0 && counter != 0)
{
headsetCount++;
totalPrice += headsettPrice;
}
if (counter %3 == 0 && counter != 0)
{
mouseCount++;
totalPrice += mousePrice;
}
if (counter %6 == 0 && counter != 0)
{
keyboardCount++;
totalPrice += keyboardPrice;
if (counter %12 == 0)
{
displayCount++;
totalPrice += displayPrice;
}
}
counter++;
}
Console.WriteLine($"Rage expenses: {totalPrice:F2} lv.");
}
}
}
Здравей и Благодаря за помощта,
Няма промяна в поведението
Ето моето решение, надявам се да ти помогне да откриеш греката
Така се получава 100/100, но ми е чудно какво толкова иска. Просто логиката е различна, но работи...