ZIO 2020 discussion

Ahir Ghosh 80 Class 12

Looks like a mistake in sorting has been made. I scored 70 (Ashish Ahuja), but it shows 60. Maybe you could use the autosort function?

Not like it matters much, but it could cause some confusion if the cutoff turns out to be greater than 60 (could it?).

1 Like

I remember the first 2.
It was:

  1. S = 4
  2. S = 10.

Last one I guess was S = 23

Add me :ParthThakur 80 11th Bhopal

Salil Gokhale Class 11 80 Marks

Sagnik Majumdar Class 11 80 Marks

Swaminathan S K - Class 10 - Score: 50

I went with lil different approach for last question, floor(2 * sqrt(n)) - 1, it might not be correct but it worked for all the three test cases, did not have to worry about anything else.

just do the floor after doubling and subtracting, u wouldn’t have to worry about that case.

I just checked the spreadsheet, and I have lowest marks! :stuck_out_tongue_closed_eyes:

Here are the solutions -

  1. Plot the points on a graph and you can clearly see that the formula is (n^2) + (n+1)^2. This can be proved easily using induction. So answers are -

i) 41 ii)221 iii)1105

  1. Just choose the right powers of two. Quite easy. So answers are -

i) 4 ii) 9 iii) 19

  1. This is also very easy. Just arrange all the numbers from both ZIO and ZCO sets into a new set in descending order. If the Kth element is repeated twice choose the largest element closest to it that is not repeated twice. So answers are -

i) 45 ii) 28 iii) 77
(Sadly, I made a blunder here. I did not see that choosing the element which gets repeated twice will increase the number of valid participants to one more than the required number of participants)

  1. Formula is floor(2sqrt(N))-1. Why? This is because we all know that a number can only have prime factors up to the square root of that number and all floor quotients up to sqrt(N) are unique. So any floor quotient after sqrt(N) gets repeated. To get those remaining floor quotients we simply have to do floor(floor(N/x)) where x<sqrt(N). We do these divisions floor(2sqrt(N)) times and since the sqrt(N) term is repeated twice we subtract one to get floor(2*sqrt(N))-1. So answers are -

i)11 ii) 23 iii) 104

Due to carelessness I only get 45. I am 11th. SMH…

I guess your answers for first question is incorrect.
1.39
2.216
3.1094
I guess you haven’t removed some cases in these questions.

The algo for that question un python is:
n=int(input())
l=[]
for i in range(1,n+1):
a=n//i
if a not in l:
l.append(a)
print(len(l))
print(l)

Mistake in the spreadsheet - Bimit is in class 12, and getting 80.

Also, when will results be out?

name: SAAD
class: 12
score: 70

1 Like

Could you please explain where are we not removing the test cases. “We” because my answers match with his.

1 Like
from itertools import permutations
s = set()
n = int(raw_input())

perm = permutations(range(-n,n+1)*2,2)
while True:
    try:
        a,b = perm.next()
        if abs(a)+abs(b) <= n:
            s.add((a,b))
    except:
        break

print s
print len(s)

Try this, you will get the right answers.

In case of question 1 the value of S given is 4 and therefore if you consider |a|=|b|=1 ,that is, (a,b)=(±1,±1),that is, (1,1),(1,-1),(-1,1) and (1,1) and therefore the case (1,1) is repeated twice and hence cases repeat.

Could you please explain me why there can’t be a case of (-1, -1) in you solution. Coz in a plane, there is a point which has the coordinates as (-1, -1).

2 Likes

Shehar Yaar - 50 - Class 12 :shushing_face: