Search found 169 matches
- Sun Aug 13, 2006 5:30 am
- Forum: Algorithms
- Topic: IOI 06 practice problem: cutting a grid
- Replies: 0
- Views: 1147
IOI 06 practice problem: cutting a grid
Problem statement: http://www.ioi2006.org/practice/cutting_a_grid.pdf My friend and I are wondering about how to do this problem. Can someone tell me if this greedy solution works? It sounds fine to me... 1. First you assume the white area is to the left, and you divide the grid turning as many time...
- Sat Jun 26, 2004 4:48 am
- Forum: C
- Topic: Exchanging two integers
- Replies: 5
- Views: 3011
- Wed Apr 21, 2004 4:31 pm
- Forum: C
- Topic: Efficiency
- Replies: 6
- Views: 3084
- Sun Apr 18, 2004 2:40 pm
- Forum: C
- Topic: Efficiency
- Replies: 6
- Views: 3084
Efficiency
Hi, I have this question that's just out of curiosity. Which of the following code is more efficient? for (i = 0; i < 10000; i++) { if (i % 5 == 0) b++; a++; } or for (i = 0; i < 10000; i++) { count++; if (count == 5) { b++; count = 0; } a++; } In short, does multiplication / division / modulus use ...
- Sun Apr 18, 2004 2:30 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10160 - Servicing Stations
- Replies: 20
- Views: 13310
Hmm... if you implemented all the heuristics listed you should get a better runtime. Try checking through your code and see if you have anything that would take a long time to run. An example of useless redundancy could be like: for (i = 0; i < 1000000; i++) a = i; when you could just have a = 99999...
- Sun Apr 18, 2004 2:20 pm
- Forum: Volume 5 (500-599)
- Topic: 561 - Jackpot
- Replies: 7
- Views: 3222
- Thu Apr 15, 2004 4:31 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10160 - Servicing Stations
- Replies: 20
- Views: 13310
This problem is quite difficult... it requires a lot of pruning... but it is possible... :D Try these suggestions: - Find all "dominating nodes", and eliminate the rest. Let A and B be the set of nodes adjacent to node a and b respectively. Let a node be connected to itself. If A is a subset of B, t...
- Sat Mar 27, 2004 7:43 pm
- Forum: Volume 6 (600-699)
- Topic: 624 - CD
- Replies: 77
- Views: 33364
- Sat Feb 21, 2004 5:06 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10342 - Always Late
- Replies: 25
- Views: 10988
Yes your output is correct. Have you tried reading this post?
http://online-judge.uva.es/board/viewto ... highlight=
http://online-judge.uva.es/board/viewto ... highlight=
- Wed Jan 28, 2004 4:34 pm
- Forum: Volume 6 (600-699)
- Topic: 668 - Parliament
- Replies: 12
- Views: 4378
- Sat Jan 24, 2004 6:36 am
- Forum: Volume 6 (600-699)
- Topic: 623 - 500!
- Replies: 187
- Views: 43923
Zhao Le: I don't really know much about DP except using Matrix How do you use matrix to find factorials? Btw for this problem would there be TLE/MLE if we just precalculate all factorials and store the numbers in arrays? I haven't tried this yet but if the memory used is not too great it sounds lik...
- Sun Jan 04, 2004 5:16 am
- Forum: Volume 6 (600-699)
- Topic: 668 - Parliament
- Replies: 12
- Views: 4378
668 Parliament - Clarifications
I think I don't understand this problem. From what I see, there is no special checker for this problem, but for the sample input (31) why is the output 2 3 5 6 7 8? Can't it be 1 3 5 6 7 9 as well? I couldn't find anything in the problem that will make the solution unique. Could someone who has solv...
- Sun Dec 21, 2003 1:25 pm
- Forum: Volume 6 (600-699)
- Topic: 626 - Ecosystem
- Replies: 8
- Views: 4924
- Sat Dec 20, 2003 6:03 am
- Forum: Volume 6 (600-699)
- Topic: 626 - Ecosystem
- Replies: 8
- Views: 4924
- Thu Dec 18, 2003 8:37 am
- Forum: Volume 1 (100-199)
- Topic: 180 - Eeny Meeny
- Replies: 34
- Views: 9730
Ok so that's where the odd number comes in. By the way I think I figured out why the answer must be less than half the lower bound. The question never numbered the positions, just that you have to find how many position away from Mxgobgwq. In short 1 can mean position 1 left or 1 right. Therefore, i...