Search found 3 matches

by rbrogan
Mon Feb 10, 2003 7:33 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 109653

You are right. Reading the problem statement carefully is the cure for insanity. Thank you for your help.
by rbrogan
Sun Feb 09, 2003 3:25 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 109653

Here is my code. It is basically simple stack manipulation.

[c]#include <stdio.h>
#ifndef ONLINE_JUDGE
#include <fcntl.h>
#endif

#define FALSE 0
#define TRUE 1
#define NIL 26

typedef struct b_type
{
int block_number;
int stack_number;
struct b_type* block_below;
} block_type;

typedef struct ...
by rbrogan
Sun Feb 09, 2003 3:17 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 109653

101 is making me insane

* Edit - the problem was I tried to handle cases where a and b are on the same stack even though the problem statement says they are illegal. Thanks to those who helped. *

I cannot figure out why I am getting wrong answer. Here is a list of things I've checked.

1) Number of blocks greater than 0 ...

Go to advanced search