Search found 32 matches

by Algoritmo
Mon May 31, 2004 9:50 am
Forum: Volume 102 (10200-10299)
Topic: 10270 - Bigger Square Please...
Replies: 25
Views: 14886

Solving method.

About 5 months ago I quit with this problem because I got lost in my code. I wished to make a fast program, that possibly wouldn't need "offline pre-calculation". I wanted to make a code that searched for solutions the same way my brain did. But at that time my way of solving was unclear. ...
by Algoritmo
Thu May 20, 2004 7:09 am
Forum: Volume 104 (10400-10499)
Topic: 10453 - Make Palindrome
Replies: 38
Views: 19975

Noim, I was not sure if you had got accepted because of this sentence: first i have determined the lcs string for the input string and the reverse of input string This would give an LCS of abcd from abcdcbad, and the palindrome would start with 8 characters in length (abcddcba) and end up with 10 (d...
by Algoritmo
Tue May 18, 2004 9:07 pm
Forum: Volume 104 (10400-10499)
Topic: 10453 - Make Palindrome
Replies: 38
Views: 19975

Sample Input/output

Noim, did you get AC ? Here is mine + your inputs: abcd aaaa abc aab abababaabababa pqrsabcdpqrs azbzczdzez aaab acaaaba zzzaaazz pooq aoob dabcdcba z aaaab abbbb ababab aaaaa abbcdba And the output my program (version 5) gives: 3 dcbabcd 0 aaaa 2 cbabc 1 baab 0 abababaabababa 9 srqpdcbasrqrsabcdpqr...
by Algoritmo
Mon May 17, 2004 3:04 am
Forum: Volume 104 (10400-10499)
Topic: 10453 - Make Palindrome
Replies: 38
Views: 19975

LCS reverse

I got all answers, exept AC. My method is simillar to what Noim described, but I do not compare the full string against it's full reverse. Instead, I stop the comparison when the left-to-right sub-string 'hits' the right-to-left sub-string. Example: dabccdba = input dabdccdbad = example of minimum s...
by Algoritmo
Sat May 15, 2004 7:46 pm
Forum: Volume 103 (10300-10399)
Topic: 10365 - Blocks
Replies: 7
Views: 5086

Finding the factors

I got correct answers for sample input but got WA after submission of code. To find the dimensions of the stack of blocks, I factored the number of blocks with this goal: F1 * F2 * F3 = Blocks F1 + F2 + F3 -->> the smallest possible I used this procedure to find F1, F2 and F3: Num = Blocks for n = 1...
by Algoritmo
Wed May 12, 2004 5:06 pm
Forum: Volume 102 (10200-10299)
Topic: 10285 - Longest Run on a Snowboard
Replies: 10
Views: 8515

10285 input

At least for this program, a pseudocode is very helpfull. I was making a pseudo-code to post here because it's easyer for others to understand. Suddenly I perceived my mistake, by reading what I wrote. I was solving it by DP in this manner: All cells start with length 0. Cells out of area have -1 of...
by Algoritmo
Sat May 08, 2004 2:58 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 52604

Alun's code

Alun, you checked for mirroring and palindroming, both things at the same time. I think it's easier if you check independently: [cpp]int Len = strlen(S); bool IsPal = true, IsMir = true; for (int i = 0; i < Len; i++) { char C = S ; char Op = S[Len-1-i]; if (C != Op) IsPal = false; if (C != Rev(Op)) ...
by Algoritmo
Tue May 04, 2004 5:01 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 32331

10327

First I thought this could be a complicated problem, but soon I wrote a 20 line code and got accepted at first submission. Many ideas passed through my mind and I would like to share them with you. Let's say we have an algorithim that flips adjacent numbers, but it's not optimal. What makes it non-o...
by Algoritmo
Fri Jan 23, 2004 12:41 pm
Forum: Volume 102 (10200-10299)
Topic: 10267 - Graphical Editor
Replies: 190
Views: 72694

I found 2 bad tricks: --K comand synthax is not K X1 Y1 X2 Y2 C, but K X1 X2 Y1 Y2 C. Why do you think K X1 Y1 X2 Y2 C would be better? In fact, the sintax is as expected: K X1 Y1 X2 Y2 C I made a mistake with that by myself. Maybe I was stressed. Note that I have edited and removed that issue from...
by Algoritmo
Fri Dec 26, 2003 10:12 pm
Forum: Volume 8 (800-899)
Topic: 843 - Crypt Kicker
Replies: 51
Views: 33561

843 How-to

I have lost some days trying to solve this problem. My code had minor errors, but I got trapped with the problem description, which in my opinion is far away from perfect. Now that I got AC, I decided to share my experience and alert others. The problem description states: A common but insecure meth...
by Algoritmo
Tue Dec 23, 2003 9:39 pm
Forum: Volume 102 (10200-10299)
Topic: 10270 - Bigger Square Please...
Replies: 25
Views: 14886

Re: why primes only?

why are you interested in primes only? for even numbers, -> ok, can be done with 4 squares what about 15 for example? it is odd and not prime, why is it easier than 3, 5 or any other prime number? Number 15 is not prime, so to get the minimum number of squares, you must use same solution you would ...
by Algoritmo
Sat Dec 13, 2003 7:19 am
Forum: Volume 102 (10200-10299)
Topic: 10267 - Graphical Editor
Replies: 190
Views: 72694

For those who still didn't get AC: This problem is relativelly simple, but took me hours. I found 1 bad trick: --in K command, X2>X1 and Y2>Y1, but this is not always true for V and H commands. I got stack overflow (R.E. SIGSEGV) with my simple resursive function, so I switched for a more complex, m...
by Algoritmo
Wed Nov 26, 2003 5:53 am
Forum: ACM ICPC Archive Board
Topic: 2354 archive problem
Replies: 2
Views: 1462

Re: 2354 archive problem

horape wrote:How do you handle:
...
Yes, you are correct. I'm impressed with the way you identified that error from such a complex description I posted. I will rethink my code. Thanks.
by Algoritmo
Wed Nov 26, 2003 5:33 am
Forum: Volume 103 (10300-10399)
Topic: 10305 - Ordering Tasks
Replies: 59
Views: 29276

None of those, believe it or not...it's the kind of error that makes you bang your head against the wall....:) Hmm now I understood your code. I had not noticed your check() function was recursive and that it did print values (I'm not used to iostream.h). But I think your code could be much simple ...
by Algoritmo
Tue Nov 25, 2003 8:23 am
Forum: Volume 103 (10300-10399)
Topic: 10305 - Ordering Tasks
Replies: 59
Views: 29276

Stupid error that I found...duh Can I make sujestions ? -=> You probably have noted that you should repeatedly print and check, not just print all then check all and quit. dep[] array is not beeing never decremented and I think you don't need so many arrays. -=> In c++ we normally count from 0 to N...

Go to advanced search