Search found 15 matches

by globi
Sat Jun 17, 2006 6:43 pm
Forum: Other words
Topic: Bricks problem
Replies: 1
Views: 1768

Bricks problem

I'm unable to solve this problem correctly. Please help me:

You have chess board of size N x M and a lot of bricks of size K x 1.
How many bricks can you place on this board (brick edges must be
pallarel to board edges)

Sample data:
N = 10, M = 10, K = 4
RESULT = 24

N = 8, M = 5, K = 5
RESULT = 8
by globi
Wed Feb 16, 2005 12:44 am
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 13495

Tip: Styles can be applied quickly to selected text.

Thanks, but I'm still looking for O(n^3) solution ;).
by globi
Fri Feb 11, 2005 9:42 pm
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 13495

104 - "Arbitrage" - plz help

Could anybody tell me, how should I modify Floyd-Warshall algo O(n^3), to receive correct answer? I know how to solve same problem (using F-W) but without limit to number of exchanges and this great 1% ;]. What I already know: 1) I change the d [j] = min(d [j], d [k] + d[k][j]) to d [j] = max(d [j],...
by globi
Tue Jun 17, 2003 9:40 am
Forum: Volume 5 (500-599)
Topic: 594 - One Little, Two Little, Three Little Endians
Replies: 46
Views: 13372

Thanks a lot ( I got accepted :) ).
by globi
Wed Jun 11, 2003 4:15 pm
Forum: Volume 5 (500-599)
Topic: 594 - One Little, Two Little, Three Little Endians
Replies: 46
Views: 13372

594 - problem with converting

Hello. If I have understood problem number 594 I should only reverse all the bytes in the data. So, I convert the data into binary ( in the string of course ), then reverse each 8-bits blocks and for half of examples I receive good answer. What's wrong in my thinking? Exaple: input: x output: y x ( ...
by globi
Mon May 12, 2003 10:26 am
Forum: Algorithms
Topic: Let's talk about Backtracking
Replies: 1
Views: 2006

Let's talk about Backtracking

Hello.

Can anyone tell me some about backtracking.
There's a lot of such problems. For ex. 524 - "Prime Ring Problem".
There are very interesting, so I want to learn some about
this algorimic method. Please help.

Thanks.

Yo
by globi
Fri May 09, 2003 2:30 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 38084

1) Could you move your code into "C++" statements ? It will be readable.

2) Remove comments from your code.

3) Possibly, the error occurs, because you are using classes in some uncompatible
style. This problem is realy easy, so you musn't use classes. One array should be enought.

Yo
by globi
Mon May 05, 2003 11:01 am
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 28309

1) I think you should better use "long long" ( 64bit integer ) than double.
It will make less problems.

2) Use precalculation ( first count everything into to table, later read
input and show answer ).

3) Your algo is good.

Yo
by globi
Thu Apr 24, 2003 7:54 pm
Forum: Volume 1 (100-199)
Topic: 144 - Student Grants
Replies: 21
Views: 3518

Ok :)

I repaired that and I accepted.

Thx.
by globi
Thu Apr 24, 2003 7:53 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 34563

Ok :)

I repaired that and I accepted.

Thx.
by globi
Thu Apr 24, 2003 7:52 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 34563

It's working now. There was an error in line

[cpp]
max = 0xffffffffff;
[/cpp]

There was too small :)

Thx everyone.
by globi
Thu Apr 24, 2003 3:48 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 34563

I sent it as cpp code, so it should work.
by globi
Wed Apr 23, 2003 2:58 pm
Forum: Volume 1 (100-199)
Topic: 144 - Student Grants
Replies: 21
Views: 3518

144 - Students Grans -WA

Hello. My program seems to work good, but the judge gives WA. Could you look at that and tell me, what wrong?! [cpp] #include <stdio.h> int lenghtof(int); int main() { int count, // ilosc studentow max, // maksymalna kwota w automacie amount, // aktualna kwota w automacie amount2, // tymczasowa kwot...
by globi
Wed Apr 23, 2003 2:53 pm
Forum: Volume 4 (400-499)
Topic: 406 - Prime Cuts
Replies: 187
Views: 22163

406 - Wrong Answer

What's wrong? Please help. [cpp] #include <stdio.h> int main() { int tab[1001], c, n, n2, count, count2, c1, c2; while(scanf("%d %d", &n, &c) == 2) { count = 0; for(int tmp = 1; tmp <= n; tmp += 2) tab[tmp] = 1; tab[2] = 1; for(int tmp = 2; tmp <= n; tmp++) for(int tmp2 = tmp*2; tmp2 <= n; tmp2 += t...
by globi
Wed Apr 23, 2003 2:49 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 34563

102 - Compile Error

Hello. I wrote program nr. 102 but I received Compile Error Could anyone help me? There's a source code: [cpp] #include <stdio.h> #define B 0 // Brown bottles #define G 1 // Green bottles #define C 2 // Clear bottles int main() { char *done; int pass; long long bins[3][3], oldbins, count, max; while...

Go to advanced search