Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Substitutes in Number (codeforces)

pascal homework

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 phananhtuan

phananhtuan

    CC Newcomer

  • Member
  • PipPip
  • 21 posts

Posted 23 October 2014 - 06:01 AM

that is one of my homewok: http://codeforces.co...t/problem/464/C

Can someone talk to me how to solve that? my program ran too slow



#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts

Posted 23 October 2014 - 09:26 AM

Well, without knowing what your code is, it is very hard to suggest what you may have done wrong. I can think of solutions that involve pure arithmetic, string manipulation, linked lists, etc, etc, etc. Depending on the language, CPU, etc, you can get very different performance characteristics, too.

 

The 1s time limit isn't something I would expect to be a significant constraint, unless they are running through hundreds of files/manipulations.


Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 phananhtuan

phananhtuan

    CC Newcomer

  • Member
  • PipPip
  • 21 posts

Posted 24 October 2014 - 05:40 PM

How? I dont have best idea



#4 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts

Posted 27 October 2014 - 05:13 AM

1) What is your current code?

2) What is your current language?

3) What is your current strategy?

 

You're asking for a solution without giving us ANYTHING to go on. If I give you a solution in VBScript, and you need a solution in C, then I haven't helped you because VBScript has language options that C does not. If I give you a solution in LISP, I can almost guarantee it won't help you at all.

 

It's entirely possible you have a perfectly good solution with a minor logic bug that made your solution O(x^2) instead of O(x), and removing that bug will fix your problem.


Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download