Find this really surprising. Always think of dp as a trade of space for time.Could someone shed some light on this?here is a dp solution using O(n) time and O(1) memory, and it is trivial to prove that the algorithm is correct. It's a little surprising.
Search found 62 matches
- Sun Jul 15, 2007 8:36 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11240 - Antimonotonicity
- Replies: 33
- Views: 16964
- Sat Jul 07, 2007 11:50 am
- Forum: Other words
- Topic: How to submit solution for the contest?
- Replies: 2
- Views: 2952
- Mon Jun 11, 2007 9:12 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11226 - Reaching the fix-point.
- Replies: 23
- Views: 14619
- Sun Jun 10, 2007 10:03 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11226 - Reaching the fix-point.
- Replies: 23
- Views: 14619
- Sun Jun 10, 2007 5:48 am
- Forum: Volume 112 (11200-11299)
- Topic: 11226 - Reaching the fix-point.
- Replies: 23
- Views: 14619
11226 - Reaching the fix-point.
I pre-calculated in a reasonable time the half million values. Where I had problems was with answering the querys. I couldn't find anything better than the naive lineal search. I realized that the maximum value was 15, but couldn't use this fact at all. So.......how did you solve this task? It had a ...
- Mon Feb 19, 2007 3:00 am
- Forum: Volume 3 (300-399)
- Topic: 385 - DNA Translation
- Replies: 11
- Views: 4316
385 DNA Translation
could you help me understand the statement? It's not very clear, how can i know if the given string is the original or complemented dna, or the reversed form of them? Moreover, if more than one of them generates protein? how can i know what to output? thx in advance
- Sun Aug 13, 2006 10:59 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11070 - The Good Old Times
- Replies: 42
- Views: 21243
- Sun Aug 13, 2006 3:00 am
- Forum: Volume 110 (11000-11099)
- Topic: 11070 - The Good Old Times
- Replies: 42
- Views: 21243
- Sun Jun 11, 2006 7:44 am
- Forum: Off topic (General chit-chat)
- Topic: Who will win the World Cup?
- Replies: 53
- Views: 137686
- Tue May 30, 2006 4:48 pm
- Forum: Off topic (General chit-chat)
- Topic: Who will win the World Cup?
- Replies: 53
- Views: 137686
though brazil is a really strong team, i guess this time they won't be at finals(3 consecutive finals is just too much) so my bet is on Argentina(Riquelme, Messi and Crespo are enough to make them strong candidates). Final i dream of is England against Argentina, you know, it's a different match for ...
- Mon May 15, 2006 5:11 am
- Forum: Volume 110 (11000-11099)
- Topic: 11032 - Function Overloading
- Replies: 43
- Views: 22432
- Mon May 15, 2006 12:01 am
- Forum: Volume 110 (11000-11099)
- Topic: 11032 - Function Overloading
- Replies: 43
- Views: 22432
- Sun May 14, 2006 9:07 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11032 - Function Overloading
- Replies: 43
- Views: 22432
- Sun May 14, 2006 8:15 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11032 - Function Overloading
- Replies: 43
- Views: 22432
- Sun May 14, 2006 3:15 am
- Forum: Volume 110 (11000-11099)
- Topic: 11032 - Function Overloading
- Replies: 43
- Views: 22432
i got this one ac(3.5 seconds, but not in contest time)
What i'm doing is to put in an array every 1<=i<=10^7 such that i!=(j+sod(j)) for j<=i, this can be done in linear time.
Let's call this "i" special numbers.
after precalculating this i answer query for fun(a) with the idea you explained above ...
What i'm doing is to put in an array every 1<=i<=10^7 such that i!=(j+sod(j)) for j<=i, this can be done in linear time.
Let's call this "i" special numbers.
after precalculating this i answer query for fun(a) with the idea you explained above ...