Skip to content

Conversation

@LusiferAjay
Copy link

please merge my PR

@AdarshRise AdarshRise added the Optimize Code Code is taking too long to show output label Oct 10, 2019
@AdarshRise
Copy link
Member

code taking too long.

@LusiferAjay
Copy link
Author

But my code Passed all the test cases of Project Eular.
can you please tell me in which test case my code taking time?

@AdarshRise
Copy link
Member

Well, I may not be able to help you with test case, but using " #include<bits/stdc++.h> " is like saying ' take every headerfile you can take',
this way of coding is helpful where coding time matters, hence we compromise time-complexity for coding time.
Try using only necessary header files.

@LusiferAjay
Copy link
Author

okk i get it thanks i will optimize my code

@LusiferAjay
Copy link
Author

can you review my code?.this time i used only required header files

@AdarshRise
Copy link
Member

Well the problem arose with Max and Min, #include <limits.h> You might need this, but even with this code is taking long time, Try to think another way of solving this problem{ i would suggest }.

@LusiferAjay
Copy link
Author

please review my code

@AdarshRise AdarshRise added the Resolve Conflict Do a Git Pull First label Oct 12, 2019
@AdarshRise
Copy link
Member

Well, I appreciate your efforts. Let me give some direct Hint.
to be on the same page, here is the problem.
image
As, you could see the given number is way big than any long long could handle. Hence, we should use char array { String } to store such large value.

And as you would be using such method of storing the numbers, keep the input within the code and avoid asking users for input. { because, some automated checks just check output and not input}.

and Int can't handle such long numbers.

@AdarshRise AdarshRise added the Provide Input Provide Input within the code as an object or function label Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Optimize Code Code is taking too long to show output Provide Input Provide Input within the code as an object or function Resolve Conflict Do a Git Pull First

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants