skate1512's blog

By skate1512, history, 6 years ago, In English

The problem
I tried writing a generator script but that didn't help.
Submission Link.

Code explanation: In the problem, we are given an array/list and we have to check if we can form 1 square and 1 rectangle with those elements(planks). Only possible values are 8, 6 6, 6 2, 4 4, 4 2 2. I tried to count the numbers of 2s, 4s, 6s and 8s. And with every query, their value is incremented or decremented. In the end, I check if the values form any of the possible values and print Yes or No according to it. If anything is greater than 8 then I count it as 8.

Edit: I was missing 6 4 in my possible values. Accepted Solution.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can u explain the problem & your solution?

  • »
    »
    6 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    In the problem we are given an array/list and we have to check if we can form 1 square and 1 rectangle with those elements(planks). Only possible values are 8, 6 6, 6 2, 4 4, 4 2 2. I tried to count the numbers of 2s, 4s, 6s and 8s. And with every query, their value is incremented or decremented. In the end I check if the values form any of the possible values and print Yes or No according to it.