JOIN
Get Time
forums  Revision History
Search My Post History  |  My Watches  |  User Settings
Forums Algorithm Matches SRM 534 Re: div 2 p1000 Revision History (3 edits)
Re: div 2 p1000 (response to post by dolphinigle)
I didn't understand your hint. X was not input, just the numbers[]...

First I thought that the numbers will decrease quickly because of second rule

if ( numbers[i] % 2 == 0 || numbers[j] % 2 == 0) {
    numbers[i] /= 2;
    numbers[j] /= 2;
}


But there is a problem, it's not decreasing so fast...
Re: div 2 p1000 (response to post by dolphinigle)
I didn't understand your hint. X was not input, just the numbers[]...

First I thought that the numbers will decrease quickly because of second rule

if ( numbers[i] % 2 == 0 || numbers[j] % 2 == 0) {
    numbers[i] /= 2;
    numbers[j] /= 2;
}


But there are two problems - it's not decreasing so fast as I thought. And the question is how many different papers I can get and not how many different winning sequences there is (that's what I tried to solve first).

For example in first test case there are two ways how to reduce { 5, 1, 1, 2, 3 } to {4, 0, 0, 2, 2 }:

  1. { 5, 1, 1, 2, 3 } --(5, 3, 'a')--> { 4, 1, 1, 2, 2 } --(1, 1, 'a')--> { 4, 0, 0, 2, 2 }
    

  2. { 5, 1, 1, 2, 3 } --(5, 1, 'a')--> { 4, 0, 1, 2, 3 } --(1, 3, 'a')--> { 4, 0, 0, 2, 2 }
    


But resulting paper is just one - "aa".
Re: div 2 p1000 (response to post by dolphinigle)
I didn't understand your hint. X was not input, just the numbers[]...

First I thought that the numbers will decrease quickly because of second rule

if ( numbers[i] % 2 == 0 || numbers[j] % 2 == 0) {
    numbers[i] /= 2;
    numbers[j] /= 2;
}


But there are two problems - it's not decreasing so fast as I thought. And the question is how many different papers I can get and not how many different winning sequences there is (that's what I tried to solve first).

For example in first test case there are two ways how to reduce { 5, 1, 1, 2, 3 } to {4, 2, 2, 0, 0 }:

  1. { 5, 1, 1, 2, 3 } --(5, 3, 'a')--> { 4, 1, 1, 2, 2 } --(1, 1, 'a')--> { 4, 0, 0, 2, 2 }
    

  2. { 5, 1, 1, 2, 3 } --(5, 1, 'a')--> { 4, 0, 1, 2, 3 } --(1, 3, 'a')--> { 4, 0, 0, 2, 2 }
    


But resulting paper is just one - "aa".
Re: div 2 p1000 (response to post by dolphinigle)
I didn't understand your hint. X was not input, just the numbers[]...

First I thought that the numbers will decrease quickly because of second rule

if ( numbers[i] % 2 == 0 || numbers[j] % 2 == 0) {
    numbers[i] /= 2;
    numbers[j] /= 2;
}


But there are two problems - it's not decreasing so fast as I thought. And the question is how many different papers I can get and not how many different winning sequences there is (that's what I tried to solve first).