Older Contests
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP ContestsOlder Contests

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 17th, 2003, 08:20 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
[numbers] How many lines, about, are in the input file?

...or will you not tell?

Just wondering if it's better to find a few solutions quickly and run to the end of the input file, or vice versa?

It's ok also if we don't know, just means more coding to cover all the bases :-)

regards,
Samuli

Reply With Quote
  #2  
Old October 17th, 2003, 10:06 AM
LAMASE LAMASE is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Rome - Italy
Posts: 21 LAMASE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
[numbers] RE: How many lines, about, are in the input file?

I hope that we will have to do our best in every situation... from one line to one hundred!

Reply With Quote
  #3  
Old October 17th, 2003, 05:21 PM
Matt Matt is offline
Contributing User
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 12 m 16 sec
Reputation Power: 7
[numbers] RE: How many lines, about, are in the input file?

The file will have at minimum 5 lines and at maximum 50 lines.

Reply With Quote
  #4  
Old October 18th, 2003, 05:02 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
[numbers] RE: How many lines, about, are in the input file?

So, in the case that there are fifty lines, the script should be able to solve each line in 30/50, or 0.6 seconds?

Example: the input file has fifty lines in it, and my script finds 100 out of 120 solutions to line one, but doesn't solve lines two through fifty, and another script finds two solutions to each of the fifty lines. Both scripts used the full 30 seconds. Which is the better script?

Reply With Quote
  #5  
Old October 18th, 2003, 05:04 PM
webhappy webhappy is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Silicon Valley, CA, USA
Posts: 203 webhappy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
[numbers] RE: How many lines, about, are in the input file?

Neither of course... If you know that the input file has 50 lines, you should optimize for that number 50.

Reply With Quote
  #6  
Old October 18th, 2003, 06:30 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
[numbers] RE: How many lines, about, are in the input file?

You say neither... but what if, just for an example, those were the only two submissions?

Reply With Quote
  #7  
Old October 18th, 2003, 07:30 PM
Matt Matt is offline
Contributing User
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 12 m 16 sec
Reputation Power: 7
[numbers] RE: RE: How many lines, about, are in the input file?


Quote:
Example: the input file has fifty lines in it, and my script finds 100 out of 120 solutions to line one, but doesn't solve lines two through fifty, and another script finds two solutions to each of the fifty lines. Both scripts used the full 30 seconds. Which is the better script?


I find it hard to believe that both scripts are going to use EXACTLY 30 seconds. The winner is going to be the faster script.

Reply With Quote
  #8  
Old October 18th, 2003, 07:33 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
[numbers] RE: How many lines, about, are in the input file?

But what if both scripts check the elapsed time periodically, and stop when they reach thirty seconds?

Reply With Quote
  #9  
Old October 18th, 2003, 07:40 PM
Matt Matt is offline
Contributing User
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 12 m 16 sec
Reputation Power: 7
[numbers] RE: How many lines, about, are in the input file?

Well first, there is going to be more than a single run of the scripts, so there will be more data to deal with. Secondly, I still find it hard to believe that both scripts are going to end up with the same run time down to the millisecond...

If for some reason after multiple runs, we have two scripts that have achieved the exact same number of solutions and have the exact same run times then we will deal with it when we get there.

Reply With Quote
  #10  
Old October 18th, 2003, 08:36 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
[numbers] RE: How many lines, about, are in the input file?

Ok, I'm satisfied now.

Reply With Quote
  #11  
Old October 28th, 2003, 10:13 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
[numbers] RE: How many lines, about, are in the input file?

at least there would be no equal lines?
and lines that have different types of distinct results?
like:
1+2+3=6 a+b+c=d
(6+2)/4=2 (a+b)/c=d
9+8-7=10 a+b-c=d

it would not be fair if all the lines has the same type of results:
1+2+3=6 a+b+c=d
2+3+4=9 a+b+c=d
5+3+7=15 a+b+c=d


Reply With Quote
  #12  
Old October 28th, 2003, 10:22 PM
Matt Matt is offline
Contributing User
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 12 m 16 sec
Reputation Power: 7
[numbers] RE: How many lines, about, are in the input file?

Sorry, I don't understand.

Reply With Quote
  #13  
Old October 28th, 2003, 11:13 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
[numbers] RE: How many lines, about, are in the input file?

ok!
suppose that for generating all the lines you use this type of logic:
for a,b,c,target;
a) a*b*c=target
b) a,b,c,(a*b*c+1) note: the results are 0

now suppose I made a script that calculates all posible combinations of a,b,c in max time of 3 seconds.

and suppose some kid makes a scripts that calculates the combination a*b*b, and no other combination, he does is on 0.5 secs.

well, by the rules, he is a winner! but if the rule a) is a-b-c=target he would not be on the winners list.

my point is that the lines on the input file should be checked, so that each line doesn't has too many results, and the results should be obtained by different combinations(since time is our limit), so that none script has performance advantage.
example:
this could be returned by one algorithm:
a+b/c=target
but this?:
(a+b)/c=target

surely one algorithm could return both, but at the cost of time.
if there are lots of a+b/c=target , the first algorithm surely will be the winner, but I belive it would not be the best, since if there are lots of (a+b)/c=target it would be a looser. But if there are the same types of results of a+b/c=target and (a+b)/c=target none of the scripts will be on the winners list, if theres a script that checks both types of results!

how could this issue be resolved?

Reply With Quote
  #14  
Old October 28th, 2003, 11:16 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
[numbers] RE: How many lines, about, are in the input file?

and suppose some kid makes a scripts that calculates the combination a*b*b, and no other combination, he does is on 0.5 secs.
_____________________________________
should be

and suppose some kid makes a scripts that calculates the combination a*b*c, and no other combination, he does is on 0.5 secs.

Reply With Quote
  #15  
Old October 29th, 2003, 12:40 AM
FryGuy1013 FryGuy1013 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Antelope, Ca
Posts: 45 FryGuy1013 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via ICQ to FryGuy1013 Send a message via AIM to FryGuy1013 Send a message via Yahoo to FryGuy1013
[numbers] RE: How many lines, about, are in the input file?

Total number returned is still higher priority than time spent. Time spent is only the tie-breaker.

For example if the numbers were 100 1 2 3 4 5 and goal was 105, then the person that gets "100+1+4" and "100+2+3" in .0000001 second (2 total) will lose to someone that gets "100+1+4", "100+2+3", "100+5", "100+1+4+5-2-3", "100+2+3+5-1-4" in 29.9999999 seconds.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > [numbers] How many lines, about, are in the input file?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek