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
Search found 15 matches
- Sat Jun 17, 2006 6:43 pm
- Forum: Other words
- Topic: Bricks problem
- Replies: 1
- Views: 1770
- Wed Feb 16, 2005 12:44 am
- Forum: Volume 1 (100-199)
- Topic: 104 - Arbitrage
- Replies: 223
- Views: 13910
Tip: Styles can be applied quickly to selected text.
Thanks, but I'm still looking for O(n^3) solution
.

- Fri Feb 11, 2005 9:42 pm
- Forum: Volume 1 (100-199)
- Topic: 104 - Arbitrage
- Replies: 223
- Views: 13910
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],...
- Tue Jun 17, 2003 9:40 am
- Forum: Volume 5 (500-599)
- Topic: 594 - One Little, Two Little, Three Little Endians
- Replies: 46
- Views: 13422
- Wed Jun 11, 2003 4:15 pm
- Forum: Volume 5 (500-599)
- Topic: 594 - One Little, Two Little, Three Little Endians
- Replies: 46
- Views: 13422
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 ( ...
- Mon May 12, 2003 10:26 am
- Forum: Algorithms
- Topic: Let's talk about Backtracking
- Replies: 1
- Views: 2015
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
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
- Fri May 09, 2003 2:30 pm
- Forum: Volume 1 (100-199)
- Topic: 101 - The Blocks Problem
- Replies: 635
- Views: 38808
- Mon May 05, 2003 11:01 am
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies: 196
- Views: 28662
- Thu Apr 24, 2003 7:54 pm
- Forum: Volume 1 (100-199)
- Topic: 144 - Student Grants
- Replies: 21
- Views: 3550
- Thu Apr 24, 2003 7:53 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 49678
- Thu Apr 24, 2003 7:52 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 49678
- Thu Apr 24, 2003 3:48 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 49678
- Wed Apr 23, 2003 2:58 pm
- Forum: Volume 1 (100-199)
- Topic: 144 - Student Grants
- Replies: 21
- Views: 3550
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...
- Wed Apr 23, 2003 2:53 pm
- Forum: Volume 4 (400-499)
- Topic: 406 - Prime Cuts
- Replies: 187
- Views: 22508
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...
- Wed Apr 23, 2003 2:49 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 49678
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...