Hi.
I was thinking about this code fragment
if (w_ptr == &head)
{
if (head.next == &head)
insert_to_list(w_ptr, &in_node);
else
insert_to_list((w_ptr->back), &in_node);
break;
}
why not just:
if (w_ptr == &head)
insert_to_list(head -> back, &in_node)
since (&head == head.next ...
Search found 7 matches
- Fri Apr 08, 2005 12:54 am
- Forum: Volume 1 (100-199)
- Topic: 105 - The Skyline Problem
- Replies: 160
- Views: 51459
- Sun Feb 13, 2005 3:39 pm
- Forum: Volume 1 (100-199)
- Topic: 118 - Mutant Flatworld Explorers
- Replies: 68
- Views: 20532
- Fri Feb 11, 2005 6:14 am
- Forum: Volume 1 (100-199)
- Topic: 118 - Mutant Flatworld Explorers
- Replies: 68
- Views: 20532
thanks...
To ImLazy: thanks for you reply. Unless I'm mistaken, your suggested logic is the same as mine, except that the first condition is doubly negated ('if not not ...'). Of course, I could very well be mistaken, in which case: could you point out which part of the code is wrong?
To everyone: it's ...
To everyone: it's ...
- Thu Feb 10, 2005 7:26 pm
- Forum: Volume 1 (100-199)
- Topic: 155 - All Squares
- Replies: 11
- Views: 3885
- Sun Feb 06, 2005 4:14 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318270
time out.
try running this:
time echo "1 1000000" | java Main
that is, take time on how long it takes to solve the biggest problem instance possible. I think you'll be surprised.
To speed it up, you might want to save some of your previous results, so you don't run through a gazillion iterations for each ...
time echo "1 1000000" | java Main
that is, take time on how long it takes to solve the biggest problem instance possible. I think you'll be surprised.
To speed it up, you might want to save some of your previous results, so you don't run through a gazillion iterations for each ...
- Sun Feb 06, 2005 4:01 am
- Forum: Volume 1 (100-199)
- Topic: 118 - Mutant Flatworld Explorers
- Replies: 68
- Views: 20532
118 WA: wtf
I get WA for problem 118, which frustrates me quite a bit, since it sounds deceptively simple. I think I've read the problem carefully enough, but I might be wrong. The only 'trick' I see is the fall-over-the-edge logic, which I understand as:
next.point = getmove(current.point)
if (next.point is ...
next.point = getmove(current.point)
if (next.point is ...
- Sat Feb 05, 2005 12:08 am
- Forum: Volume 1 (100-199)
- Topic: 109 - SCUD Busters
- Replies: 96
- Views: 36960