Search found 88 matches

by technobug
Fri Mar 05, 2004 6:45 pm
Forum: Volume 101 (10100-10199)
Topic: 10132 - File Fragmentation
Replies: 24
Views: 11336

which means, multiple input should be ok, right?
by technobug
Fri Mar 05, 2004 6:44 pm
Forum: Volume 101 (10100-10199)
Topic: 10132 - File Fragmentation
Replies: 24
Views: 11336

input file:

Code: Select all

9

1
1

00
00
1
1

0
0

1
0

0
1

011
0111

011
10111
0111
0111

1234
56
12
3456

011
0111
01110
111
0111
10111
011101
11
output:

Code: Select all

11

001

00

10

01

0110111

01110111

123456

01110111
by technobug
Fri Mar 05, 2004 6:41 pm
Forum: Volume 101 (10100-10199)
Topic: 10132 - File Fragmentation
Replies: 24
Views: 11336

hmmm... it prints a blank line between test cases and no blank line at the end, aint that right?

i will add some input/output soon
by technobug
Fri Mar 05, 2004 1:37 am
Forum: Volume 101 (10100-10199)
Topic: 10132 - File Fragmentation
Replies: 24
Views: 11336

10132 - File Fragmentation

I have solved it sucessfully at programmingchallenges.com but got wrong answer at uva's site.... I have tried a simple approach and a more robust one (with some better pruning)... i am only posting the simple one which is smaller. I don't believe there is something that I might be missing: - last li...
by technobug
Sat Feb 28, 2004 4:01 am
Forum: Volume 100 (10000-10099)
Topic: 10044 - Erdos Numbers
Replies: 102
Views: 39917

10044

Hey there, I was going through the exercices when I got to this one. Seem very simple to be implemented: just create the graph and look for the minimum line connecting two points... if they are not connected, leave it.... I did not want to use arrays (I wanna train my stl skills hehehe) so my code i...
by technobug
Tue Feb 24, 2004 8:53 am
Forum: Java
Topic: ACMIO.java - why not to make it standard?
Replies: 5
Views: 2642

i reckon would be better to support jdk 1.3 (of course 1.4 would be better, 1.5 beta would be lovely).... collections, biginteger, io... hmmm....
by technobug
Tue Feb 24, 2004 8:50 am
Forum: Java
Topic: A very good FREE Java Book
Replies: 2
Views: 2848

IMHO Thinking in Java is not the best way to learn Java at all... Anyhow, there are good tutorials on the sun website and the best (non free) book is, in my opinion, the Deitel & Deitel one... Sun website: java.sun.com For info in portuguese, guj is one of the best locations for starters: http://www...
by technobug
Tue Feb 24, 2004 8:48 am
Forum: Java
Topic: speed of java and c++
Replies: 20
Views: 9084

As someone mentioned, they were made for different purposes. I work with Java but also love C++, so just for the records, those who are not familiar with Java and still have got that prejudice which says "Java is slower, will always be... bla bla bla": - The Java virtual machine is responsible for i...
by technobug
Tue Feb 24, 2004 8:40 am
Forum: Java
Topic: JAVA-Difficulties We Face
Replies: 31
Views: 26446

As it was mentioned before, the lack of some usefull classes really sucks. Using a jdk1.1 compatible version REALLY sucks. So when I have to use some real data structures i use C++ + STL, and for everything else I am using Java. When I need to do some nice graph search algorithm it breaks my heart n...
by technobug
Sat Nov 29, 2003 3:50 pm
Forum: Volume 3 (300-399)
Topic: 383 - Shipping Routes
Replies: 27
Views: 6038

383 - Shipping Routes

Hello there, I am trying to solve 383, where the aim is to find the minimum path between two vertexes in a three. I use a class called Node to represent a vertex and another one called Path to represent a path between two nodes. First, as I read the connections I put the nodes appart by setting thei...
by technobug
Thu Nov 27, 2003 4:15 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 21603

Ne... i did not get it I got it right when i did the whole backtracking system (with some nice purges, of course) I am not a real big academic guy... im just starting reading so i saw its a basic algo..... anyhow, this exercice is not really the actual coloring as it allows WHITE-WHITE..... as u sai...
by technobug
Thu Nov 27, 2003 1:10 pm
Forum: Volume 5 (500-599)
Topic: 524 - Prime Ring Problem
Replies: 74
Views: 19346

I just got it in .592.... i will run through my code today to improve it (c++ --> c with scanf/printf) 1. I did not generate the prime numbers during runtime but cached them. 2. Only do the recursive call when your number is prime 3. Avoid calls with too many parameters (does it really affect perfor...
by technobug
Sun Nov 23, 2003 10:06 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 21603

193 Graph Coloring Algorithm - Dynamic programming?

I tried a greedy algorithm (that I took out from my mind...) and got WA.... so I am gonna try the brute force + dynamic programming.... but just to check if there is another solution.... I used something like: 1. Get the vertex with less connections 2. Paint it black 3. Paint every vertex connected ...

Go to advanced search