11290 - Gangs

All about problems in Volume 112. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

11290 - Gangs

Post by helloneo »

Hello..~
What is the correct output for this case..?

Code: Select all

1 1
1 2
0 0
Thanks.. :-)
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind »

my wrong answer code gives

Code: Select all

<empty string>
ERROR
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

I keep getting WA for this problem too.
Is there any bound on the input rank?

I got it finally.
read the problem statement carefully to figure out the comparisons.
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind »

A run R1 is more OG than a run R2 if and only if:

* R2 returns to the Green Line for the first time at an earlier point than when R1 returns to the Green Line, or
* R1 and R2 return to the Green Line at the same point, but the portion of R1 to that point (ignoring the initial E and final S) is more OG than the portion of R2 to that point (also ignoring the initial E and final S), or
* R1 and R2 return to the Green Line at the same point and are identical to that point, but the rest of R1 is more OG than the rest of R2.

Examples corresponding to these three cases:

* EESS is more OG than ESES.
* EESSES is more OG than ESESES.
* EESSEESS is more OG than EESSESES.

As far as I understand the second example fall into the first case. why it is represented as an example of second case?
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

That is definitely a mistake by the problemsetter.
Here's a correct example for case 2:

EEESSSES is more OG then EESESSES
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind »

I need some critical inputs..
DavidDeharbe
New poster
Posts: 8
Joined: Sun May 16, 2004 12:48 am
Contact:

Post by DavidDeharbe »

emotional blind wrote:I need some critical inputs..
Check this:
http://plg.uwaterloo.ca/~acm00/

Good luck!

David.
--
Last edited by DavidDeharbe on Sat Oct 06, 2007 12:32 am, edited 1 time in total.
Lomir
New poster
Posts: 19
Joined: Mon Sep 17, 2007 10:05 pm
Contact:

Post by Lomir »

run R1 is more OG than a run R2 if and only if:
R2 returns to the Green Line for the first time at an earlier point than when R1 returns to the Green Line, or

R1 and R2 return to the Green Line at the same point, but the portion of R1 to that point (ignoring the initial E and final S) is more OG than the portion of R2 to that point (also ignoring the initial E and final S), or

R1 and R2 return to the Green Line at the same point and are identical to that point, but the rest of R1 is more OG than the rest of R2.
I have a question on the 2nd rule.
If R1 and R2 returns to the green line for the first time at the same point, then we must compare paths before this point (and later if it is still equal after this point).
First rule states comparison only by reaching green line for the first time, however second rule states that green line was reached at the same point, so first rule can not be applied to compare paths before.

Which path is more OG and according to which rule or rules?
EEESSS and EESESS ??
Both path reaches green line for the first time at the same point (3,3).
Before it none of the paths reaches the green line, so we can not apply the 1st rule to the begining of the path.
After point (3,3) there is no path left, so we can not apply the 3rd rule either.
DavidDeharbe
New poster
Posts: 8
Joined: Sun May 16, 2004 12:48 am
Contact:

(tentative) explanation

Post by DavidDeharbe »

Lomir wrote:
run R1 is more OG than a run R2 if and only if:
R2 returns to the Green Line for the first time at an earlier point than when R1 returns to the Green Line, or

R1 and R2 return to the Green Line at the same point, but the portion of R1 to that point (ignoring the initial E and final S) is more OG than the portion of R2 to that point (also ignoring the initial E and final S), or

R1 and R2 return to the Green Line at the same point and are identical to that point, but the rest of R1 is more OG than the rest of R2.
I have a question on the 2nd rule.
If R1 and R2 returns to the green line for the first time at the same point, then we must compare paths before this point (and later if it is still equal after this point).
First rule states comparison only by reaching green line for the first time, however second rule states that green line was reached at the same point, so first rule can not be applied to compare paths before.

Which path is more OG and according to which rule or rules?
EEESSS and EESESS ??
Both path reaches green line for the first time at the same point (3,3).
Before it none of the paths reaches the green line, so we can not apply the 1st rule to the begining of the path.
After point (3,3) there is no path left, so we can not apply the 3rd rule either.
According to the second rule, since they reach the green line at the same point, you need to compare them without the first E and the last S, i.e. EESS and ESES. Since EESS is more OG than ESES by rule 1, then EEESSS is more OG than EESESS.

That is how I understand the rules, anyway. Good luck!

David.
--
--
Post Reply

Return to “Volume 112 (11200-11299)”