Search found 144 matches

by cyfra
Tue Oct 12, 2004 11:17 am
Forum: Volume 107 (10700-10799)
Topic: 10716 - Evil Straw Warts Live
Replies: 1
Views: 3024

Hi! My solution (which got AC ;-) was quite simple : for each letter find it's first and last occurence in current string. select letter for which sum of distances from it's first occurence to beginning and from last one to the end is smallest. "move it" I mean swap it's first occurence to beginning...
by cyfra
Tue Oct 12, 2004 11:10 am
Forum: Volume 107 (10700-10799)
Topic: 10735 - Euler Circuit
Replies: 14
Views: 4380

Hi! my solution was similar : - find maximal matching beetween points ( we are trying to match points that have indeg-outdeg > 0 with points that have indeg-outdeg < 0 ) thanks to this we can direct some undirected edges. So now if for all verticles indeg(v)==outdeg(v) and degree(v) is even the eule...
by cyfra
Fri Feb 27, 2004 3:21 pm
Forum: Volume 106 (10600-10699)
Topic: 10627 - Infinite Race
Replies: 10
Views: 7092

I found my mistake .....

just a small one ;-) I had some problems, when they could met in the last minute ....

Thanks a lot for help

Best Regads
by cyfra
Fri Feb 27, 2004 11:46 am
Forum: Off topic (General chit-chat)
Topic: Submission Error in "ARCHIVE"
Replies: 5
Views: 3998

You have to choose the task you want to submit, and there is a button Submit near it ...

Because you have to use different submit script
by cyfra
Fri Feb 27, 2004 11:43 am
Forum: Algorithms
Topic: what is the strategy for finding ...
Replies: 1
Views: 1398

Hi! If you are writing about task 590 : there you have to use some kind of dynamic programming ... let us assume that we have an array [1..n][1..k] in the cell with index [a] there is an integer which is the smallest amount of money she has to spent to get to city number a after b days ... You begin...
by cyfra
Fri Feb 27, 2004 11:35 am
Forum: Volume 106 (10600-10699)
Topic: 10627 - Infinite Race
Replies: 10
Views: 7092

Hi!
Thanks for answering ...
Adrian Kuegel wrote: Try this input:
1 2147483647 2147483647 2147483647
Unfortunately I use long long's for this and I don't think this may cause overflow problems..
My answer for this test is :

4611686014132420609

(Or is it wrong answer ??? )
by cyfra
Fri Feb 27, 2004 10:46 am
Forum: Volume 106 (10600-10699)
Topic: 10627 - Infinite Race
Replies: 10
Views: 7092

10627 - Infinite Race

Hi!

I tried to code this task on the contest but got WA.
Later I rewrote this task (this time without using any floats etc) and still got WA..

Does anyone have any tricky inputs for this task ??

Thanks in advance
Good Luck :wink:
by cyfra
Sat Oct 25, 2003 11:54 pm
Forum: Volume 105 (10500-10599)
Topic: 10559 - Blocks
Replies: 37
Views: 12217

Hi! I basically had two approaches in mind. 1) only store the best score for a colour 2) only consider (if they exist) z that have the same colour of a. Yes. You are right that the first one is wrong.. But the second one is what I thought about.. So if you have a to count the range from a to b .. Yo...
by cyfra
Thu Oct 23, 2003 10:01 pm
Forum: Volume 105 (10500-10599)
Topic: 10559 - Blocks
Replies: 37
Views: 12217

Re: 10559 Blocks problem TLE

Hi ! Hmmm, I still don't get it completely... Do you mean something like this: [c] struct erased { int colour; int ndeleted; int score; struct erased * nextcolour; }; struct erased *array[a] ; [/c] Yes that's was I was thinking about. . So now, (as you can easily see) the memory you need is much muc...
by cyfra
Wed Oct 22, 2003 12:11 am
Forum: Volume 105 (10500-10599)
Topic: 10559 - Blocks
Replies: 37
Views: 12217

Re: 10559 Blocks problem TLE

What is the value? The score obtained erasing the range of blocks? Yes.. It is what I was thinking about... I understand that if I have two adiacent ranges of the same colour like this: [a, i, c, d]=k [i+1, b, c, e]=l then I get: [a,b,c,d+e]=k+l+2*d*e If I have adiacent ranges of different colours:...
by cyfra
Tue Oct 21, 2003 12:37 am
Forum: Volume 105 (10500-10599)
Topic: 10559 - Blocks
Replies: 37
Views: 12217

Hi! Yes I will help you, as much as I can ;-) So I can give you a few hints : 1. Think about dynamic programming... where you have to fill the array[1..n,1..n,1..n,1..n] .. Descirption : if value of [a,b,c,d] = n then it is possible to "erase" all the elements beetween position a and position b, the...
by cyfra
Fri Oct 17, 2003 7:47 pm
Forum: Volume 105 (10500-10599)
Topic: 10559 - Blocks
Replies: 37
Views: 12217

Hi!

Everything depends on your algorithm ....

You can reduce your running time (and complexity) very easy...

But first, could you write what algorithm do you use ..


Otherwise, I cannot help you

Good Luck :wink:
by cyfra
Mon Oct 13, 2003 12:54 am
Forum: Volume 105 (10500-10599)
Topic: 10558 - A Brief Gerrymander
Replies: 6
Views: 5050

Hi!

There is only simple DP. But you have to consider avenues 1 and 100 also, and remember that if you were said to divide it with 8 avenues, you have to output 8 avenues (even if the same optimal anser is for 4 )

I hope I will help you

Best regards

CYFRA
by cyfra
Tue Jul 29, 2003 1:00 pm
Forum: Volume 105 (10500-10599)
Topic: 10537 - The Toll! Revisited
Replies: 27
Views: 10090

Hi! Hmm.. your method is good. I also did it with Dijkstra for finding the shortest pathes... (and got AC in less then 1sec) But I think that there are 2 things that can cause TLE... 1.) Check how long your function for visiting cities works. ( the function, that counts the minimal number of cash yo...
by cyfra
Thu May 22, 2003 10:50 am
Forum: Volume 7 (700-799)
Topic: 700 - Date Bugs
Replies: 7
Views: 6537

Look carefully at the limits ;-)


That was my bug...

Hope it will help

Good Luck :wink:

Go to advanced search