Search found 4 matches

by unabl4
Sat Jun 29, 2013 1:12 am
Forum: Volume 100 (10000-10099)
Topic: 10003 - Cutting Sticks
Replies: 59
Views: 37737

Re: 10003 - Cutting Sticks

I've tried defining memoization array like

Code: Select all

stCutCost iCutsCosts[2601]; // 51 by 51 
but I get the same error :(
by unabl4
Wed Jun 26, 2013 1:25 am
Forum: Volume 100 (10000-10099)
Topic: 10003 - Cutting Sticks
Replies: 59
Views: 37737

Re: 10003 - Cutting Sticks

Can you tell what is wrong with my code ? The Runtime error only occures if I manage to memoize the cut cost value (i.e calling vMemoize() function). I just simply don't get it, why should I rewrite the algorithm itself, if it works ? :-?
by unabl4
Tue Jun 25, 2013 1:27 am
Forum: Volume 100 (10000-10099)
Topic: 10003 - Cutting Sticks
Replies: 59
Views: 37737

Re: 10003 - Cutting Sticks


#include "stdio.h"
#include "stdlib.h"

#define NA -1

typedef struct {
int iFromIndex;
int iToIndex;
int iCost;
} stCutCost;

int iNumberOfCuts; // The number of cuts to be done
int iLength; // The overall length of the stick
int *iCuts; // The array that holds the cut markers (lengths)
int ...
by unabl4
Mon Jun 24, 2013 4:03 pm
Forum: Volume 100 (10000-10099)
Topic: 10003 - Cutting Sticks
Replies: 59
Views: 37737

Re: 10003 - Cutting Sticks

Hello everyone!

I've composed a program using algorithm from "algorithmist" (recursion. Although, I got this solution by myself, without peeking), but without memoization. For my submission I've received: Time Limit Exceeded , which could be kinda obvious (because some say - the test input is huge ...

Go to advanced search