Search found 12 matches

by Hardi
Thu Jun 16, 2005 2:41 pm
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 37313

No it doesn't. Explain me the Floyd-Warshall algorithm
I don't know anything about O(n^3) or O(n^2) etc...
by Hardi
Tue Jun 14, 2005 2:00 pm
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 65327

Don't be mad.
The point of writing solutions for problems is having fun and educating yourself. I don't know where the bug is - I am still trying to solve problem no. 104
by Hardi
Tue Jun 14, 2005 12:00 pm
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 37313

104

Hy.
Please explain me, how does Floyd-Warshall algorithm work and how can I use it to solve the Arbitrage problem.
by Hardi
Mon Jun 13, 2005 9:22 pm
Forum: C++
Topic: Which is the best c++ IDE program?
Replies: 3
Views: 2585

yeah. I am using DevCpp. It's a cool IDE, but I hate it's debugger, it's buggy :P
by Hardi
Mon Jun 13, 2005 7:19 pm
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 37313

I think something is wrong:

Sample Input

3
1.2 .89
.88 5.1
1.1 0.15
4
3.1 0.0023 0.35
0.21 0.00353 8.13
200 180.559 10.339
2.11 0.089 0.06111
2
2.0
0.45

Sample Output

1 2 1
1 2 4 1
no arbitrage sequence exists

In the 2th input:

The table:
| 1 | 2 | 3 | 4 ...
by Hardi
Mon Jun 13, 2005 12:59 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 108900

Hy again.
Thank you for your test input.
My program was accepted in 0:00.20 sec and the amount of memory was 64 kbytes(I think, but still 64).
by Hardi
Sat Jun 11, 2005 2:55 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 108900

I have a problem
Input:
5
move 1 onto 0
move 2 onto 0
move 3 onto 0
move 0 over 4

Is the output like that:

0:
1:
2:
3:
4: 0 ?

And does moving to initial position mean the same as move "the box that has to be moved" to "the value of the box" e.g:
0: 1 2
1:
2:
3:
4:

move 0 over 4:
0:
1:
2:
3:
4: 0
by Hardi
Sat Jun 11, 2005 10:57 am
Forum: Volume 1 (100-199)
Topic: 103 - Stacking Boxes
Replies: 200
Views: 50420

Accpeted

Ok, here's the deal.
I rewrote my code and It got Accepted.

"Your C++ program has solved Ok the problem 103 (Stacking Boxes)
in 0.436 seconds using as much as 392 kbytes of virtual memory.
Congratulations!"

My code:

Code: Select all

/*******************************
 *
by Hardi
Sat Jun 11, 2005 10:40 am
Forum: Volume 1 (100-199)
Topic: 103 - Stacking Boxes
Replies: 200
Views: 50420

What does that DP abbreviation mean and how does that algorithm work.

Now if I understood the problem correctly, I have to rearrange the measurments of 1 box so that it will fit into a bigger box, which measurements are bigger than the box, whose measurements I changed.

As I can see, you sort the ...
by Hardi
Sat Jun 11, 2005 10:31 am
Forum: Volume 1 (100-199)
Topic: 103 - Stacking Boxes
Replies: 200
Views: 50420

Thank you for your answer.
I'll try to figure out a way to read from input with scanf. cin is slower than scanf.
by Hardi
Sat Jun 11, 2005 8:57 am
Forum: Volume 1 (100-199)
Topic: 103 - Stacking Boxes
Replies: 200
Views: 50420

Input error

Hy.
I just can't understand what's wrong.
I was writing a solution for problem 103.
I compiled the program and it seems to read the input wrongly.

Code: Select all

/*******************************
 *
by Hardi
Fri Jun 10, 2005 2:55 pm
Forum: Volume 1 (100-199)
Topic: 103 - Stacking Boxes
Replies: 200
Views: 50420

I have a problem with my solution.
Here's what my program does:
1. reads the input and stores it into an array
2. It will put the numbers increasingly in the same array:
if the input is
--- /*start of input*/
1 6
1 8 3 2 10 20
--- /*end of input*/

So:
1 2 3 8 10 20

then it will compare all the ...

Go to advanced search