×

# Codeforces 955A - Feed the cat Need help

 1 I am trying to solve Feed The Cat. But My implementation is failing 8th test case which is: 20 55 100000 100 100 100  Can anyone help in finding mistake in my implementation. Here is my code: #include #include using namespace std; double calculateMinutesToEight(double h, double m) { int m1,m2; m1 = 60 - m; m2 = (20 - (h+1))*60; return m1 + m2; } double beforeEight(double reqH, double c) { double res = reqH * c; return res; } double afterEight(double reqH, double c) { double discount,ans; discount = (reqH * c) * 0.2; ans = (reqH * c) - discount; return ans; } int main() { // your code goes here double hh,mm,h,d,c,n; cin>>hh>>mm>>h>>d>>c>>n; double requiriedBuns1 = ceil(h/n); double result1 = beforeEight(requiriedBuns1,c); double result2,extraTime,requiriedBuns2; cout<

 2 @montycs plz add this line to your code after calculating min to eight cout<<"min to eight "<
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×2,718
×825
×672

question asked: 27 Mar '18, 13:55

question was seen: 589 times

last updated: 27 Mar '18, 21:31