Search found 19 matches
- Tue Mar 17, 2015 3:48 am
- Forum: Volume 11 (1100-1199)
- Topic: 1194 - Machine Schedule
- Replies: 1
- Views: 2257
Re: 1194 - Machine Schedule
I have a simple recursive algorithm that brute-forces, trying to put each job either on machine1 or machine2. Since there are k jobs, this is O(2^k). I have the "optimization" of eliminating the job choice if either machine was previously in the required mode, which reduces the runtime to O(2^(m+n ...
- Fri May 30, 2014 2:18 am
- Forum: Volume 127 (12700-12799)
- Topic: 12765 - Factorial Products
- Replies: 8
- Views: 2277
Re: 12765 - Factorial Products
Here's mine. I think the input does not follow the description 100%, so make sure you follow Brian's advice.
Input
1 1
9
9
1 2
5
3 6
1 3
9
1 9 0
1 4
9
7 3 3 2
2 4
6 6
5 3 5 3
10 17
0 1 2 3 4 5 6 7 8 9
7 7 7 5 5 3 3 3 3 3 2 2 2 2 2 2 2
1000
1000
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 ...
Input
1 1
9
9
1 2
5
3 6
1 3
9
1 9 0
1 4
9
7 3 3 2
2 4
6 6
5 3 5 3
10 17
0 1 2 3 4 5 6 7 8 9
7 7 7 5 5 3 3 3 3 3 2 2 2 2 2 2 2
1000
1000
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 ...
- Tue May 13, 2014 2:13 am
- Forum: Volume 127 (12700-12799)
- Topic: 12765 - Factorial Products
- Replies: 8
- Views: 2277
Re: 12765 - Factorial Products
You are a genius! I modified my program the way you suggested and now I get Accepted. I wonder what the judges input really looks like. Should I mention it to the administrators in case other people are getting tripped up? Thanks again!
Jason Winokur
Jason Winokur
- Sat May 10, 2014 2:41 am
- Forum: Volume 127 (12700-12799)
- Topic: 12765 - Factorial Products
- Replies: 8
- Views: 2277
Re: 12765 - Factorial Products
I think my code handles any integers for N and M. Should I terminate the program if either N or M is outside the [1..1000] range? Do I have to parse N and M as if they could contain commas, e.g. "1,000 1,000"? The problem description says that the input will end with a line containing two zeros. I ...
- Fri May 09, 2014 2:10 am
- Forum: Volume 127 (12700-12799)
- Topic: 12765 - Factorial Products
- Replies: 8
- Views: 2277
Re: 12765 - Factorial Products
Thanks for the reply, but it still throws an exception parsing the input. Any other suggestions?
- Thu May 08, 2014 3:34 am
- Forum: Volume 127 (12700-12799)
- Topic: 12765 - Factorial Products
- Replies: 8
- Views: 2277
12765 - Factorial Products
I am struggling to get my programming to read the input for this seemingly simple problem. Here is my Java code that throws an Exception while only trying to read the input. Are there any tricks to reading the input? Any insights would be much appreciated.
import java.io.*;
import java.util ...
import java.io.*;
import java.util ...
- Mon Nov 19, 2007 12:11 am
- Forum: Volume 113 (11300-11399)
- Topic: 11341 - Term Strategy
- Replies: 20
- Views: 11515
- Sun Nov 18, 2007 11:09 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11341 - Term Strategy
- Replies: 20
- Views: 11515
- Mon Jan 23, 2006 10:02 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10569 - Number Theory
- Replies: 19
- Views: 9165
- Mon Jan 23, 2006 2:36 am
- Forum: Volume 100 (10000-10099)
- Topic: 10080 - Gopher II
- Replies: 31
- Views: 26925
- Wed Sep 08, 2004 11:35 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10306 - e-Coins
- Replies: 9
- Views: 8143
I have been testing my program, which uses dynamic programming, with the program above. My program is much slower but I get the same answers for hundreds of randomly generated input tests. Time is not the problem, since I have been getting Wrong Answer. Can somebody post some possibly tricky inputs.
- Mon Sep 06, 2004 6:54 am
- Forum: Volume 102 (10200-10299)
- Topic: 10221 - Satellites
- Replies: 34
- Views: 20329
- Tue Aug 10, 2004 5:04 am
- Forum: Volume 7 (700-799)
- Topic: 705 - Slash Maze
- Replies: 13
- Views: 12856
- Mon Jan 12, 2004 11:58 am
- Forum: Volume 101 (10100-10199)
- Topic: 10127 - Ones
- Replies: 32
- Views: 18069
- Fri Jan 09, 2004 8:00 am
- Forum: Volume 8 (800-899)
- Topic: 837 - Light and Transparencies
- Replies: 25
- Views: 19684