Search found 132 matches
- Wed Aug 18, 2004 6:01 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10559 - Blocks
- Replies: 37
- Views: 12217
- Wed Aug 18, 2004 9:00 am
- Forum: Volume 105 (10500-10599)
- Topic: 10559 - Blocks
- Replies: 37
- Views: 12217
I used dynamic memory allocation to minimaze memory usage. type tarr = array[1..maxn]of word; parr = ^tarr; var inf : array[1..maxn, 1..maxn]of parr; ... getmem(inf[i, j], (j - i + 1) shl 1) To speed-up my solution I used 2 ideas: 1.) if inf[i, j, k] = 0 then you should not consider this element in ...
- Tue Aug 17, 2004 8:49 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10559 - Blocks
- Replies: 37
- Views: 12217
- Tue Aug 17, 2004 4:39 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10559 - Blocks
- Replies: 37
- Views: 12217
Yes, I have seen you submision :) But you write please refer to gush's post in the other thread(use search for 10559) gush wrote color[z] must be defferent from color[z + 1] and color[z + 1] should be the same as color This aproach is wrong. You also should consider then color[z] and color are the s...
- Tue Aug 17, 2004 6:44 am
- Forum: Volume 105 (10500-10599)
- Topic: 10559 - Blocks
- Replies: 37
- Views: 12217
- Fri Aug 13, 2004 9:55 am
- Forum: Volume 105 (10500-10599)
- Topic: 10559 - Blocks
- Replies: 37
- Views: 12217
10559 TLE
I've got TimeLimitExceeded with my DP algorithm: Let Inf[i, j, k] be the highest score that I can get from i postion to j position clicking j-th box at last and length of the last segment is k Then Inf[i, i, 1] = 1 Inf[i, i + 1, 1] = 2 if color[i] <> color[i + 1] Inf[i, i + 1, 2] = 4 if color[i] = c...
- Sun Aug 08, 2004 3:27 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10647 - Optimal House Placement
- Replies: 3
- Views: 2372
- Sat Aug 07, 2004 5:51 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10686 - SQF Problems
- Replies: 21
- Views: 11837
- Fri Jul 02, 2004 10:24 am
- Forum: Volume 106 (10600-10699)
- Topic: 10679 - I Love Strings!!
- Replies: 101
- Views: 48492
Bad test data
Let's talk about 10679's tests. I think that they are very easy. First of all, if in Aho-Corasick you compute failure function in dfs order you got accepted. That's very strage, because almost every randomized test check this. Aho-Corasick have complexity O(m + z), where z is the number of pettern o...
- Fri Jul 02, 2004 9:20 am
- Forum: Volume 106 (10600-10699)
- Topic: 10679 - I Love Strings!!
- Replies: 101
- Views: 48492
- Wed Jun 30, 2004 7:05 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10679 - I Love Strings!!
- Replies: 101
- Views: 48492
Can anyone explain me why my code (it was accepted 3 days later) gets TLE :evil: . I am using KMP [pascal]{$A-,B-,D+,E+,F-,G-,I-,L-,N-,O+,P-,Q-,R-,S-,T-,V-,X+} const maxlen = 110000; type my_string = record len : longint; sa : array[1..maxlen]of char; end; procedure read_str(var a : my_string); var ...
- Wed Sep 03, 2003 7:04 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10542 - Hyper-drive
- Replies: 9
- Views: 5224
Strange..
It is really very strange, because the same code in C++ get Accepted. Why it happened?
- Wed Sep 03, 2003 3:23 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10542 - Hyper-drive
- Replies: 9
- Views: 5224
Need help
I write a program using PIE but it get WA. Please, help me! [pascal]Program p10542; Var T, t_id : Integer; i, D : Integer; j : Int64; a, b : Array[1..10]of Int64; function gcd(a, b : Int64) : Int64; begin if a = 0 then gcd := b else gcd := gcd(b mod a, a); end; procedure rec(id, v : integer; g : Int...
- Tue Sep 02, 2003 9:32 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10542 - Hyper-drive
- Replies: 9
- Views: 5224
I also got WA many times. My program output in the last test case "15484". I think it is right. Can anybody explain to me why the answer 15484 is incorrect. Look at my program for my algorithm (I can't explain it using only words :) ): [pascal]Program p10542; Type Integer = Int64; Var T, t_id : Long...
- Mon Sep 01, 2003 2:44 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10547 - Hidden Truth in Recurrence
- Replies: 7
- Views: 2983