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 16th, 2003, 12:32 AM
zackcoburn zackcoburn is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 184 zackcoburn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[numbers] Time limit

xs0 used to give a script that would run in the allotted time limit on the judging machine, so that participants could estimate how long their scripts would run when on the judging machine.

Will a script of that nature (that runs in 30 seconds on the judging machine) be provided?

Reply With Quote
  #2  
Old October 16th, 2003, 01:21 PM
Matt Matt is offline
Moderator
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 10 m 20 sec
Reputation Power: 6
[numbers] RE: Time limit

I will work something up this evening and post it here....

Reply With Quote
  #3  
Old October 16th, 2003, 11:21 PM
Matt Matt is offline
Moderator
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 10 m 20 sec
Reputation Power: 6
[numbers] RE: Time limit

php Code:
Original - php Code
  1. <?
  2. error_reporting(E_ALL & ~E_NOTICE);
  3. mt_srand(123);
  4.  
  5. $start=microtime();
  6.  
  7. $dummy=array();
  8. for ($a=0; $a<700000; $a++) {
  9.     $n=$a%3;
  10.     if ($n==0) {
  11.         $dummy[mt_rand(0,100)][mt_rand(0,100)]=mt_rand(0,100);
  12.     } else
  13.     if ($n==1) {
  14.         $source=mt_rand(0,100);
  15.         $target=mt_rand(0,100);
  16.         $tmp=$dummy[$source];
  17.         $dummy[$source]=$dummy[$target];
  18.         $dummy[$target]=$tmp;
  19.     } else
  20.     if ($n==2) {
  21.         $which=mt_rand(0,100);
  22.         if (is_array($dummy[$which]))
  23.             asort($dummy[$which]);
  24.     }
  25. }
  26.  
  27. $end=microtime();
  28.  
  29. list($a,$b)=explode(" ", $start);
  30. list($c,$d)=explode(" ", $end);
  31.  
  32. echo ($c+$d-$a-$b)." seconds...n";
  33.  
  34.  
  35. ?>

Reply With Quote
  #4  
Old October 29th, 2003, 04:00 PM
maxhb maxhb is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Bremen, Germany
Posts: 48 maxhb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[numbers] RE: RE: Time limit

Hi Matt!
I just tested your "30 second script" and wondered why it takes more than 50 secs on my old Pentium 700 computer. I'm just gessing but it looks like you are not using ZendOptimier on your machine?

CU
maxhb

Reply With Quote
  #5  
Old October 29th, 2003, 06:27 PM
Matt Matt is offline
Moderator
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 10 m 20 sec
Reputation Power: 6
[numbers] RE: Time limit

Nope..no ZendOptimizer...

this script was run on a Celeron 1.2Ghz with 256 megs of ram...running Windows 2000 Advanced Server....I know...I know....



Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > [numbers] Time limit


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway