0% found this document useful (0 votes)
94 views5 pages

Zio2024 Question Paper

The document provides instructions for a zonal informatics olympiad. It details that the question paper is worth 80 marks split across 4 problems, each worth 20 marks. It provides examples of 3 test cases for each problem. It explains how the problems and test cases will be formatted and presented to candidates. It also provides rules around submitting answers.

Uploaded by

satyajit101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views5 pages

Zio2024 Question Paper

The document provides instructions for a zonal informatics olympiad. It details that the question paper is worth 80 marks split across 4 problems, each worth 20 marks. It provides examples of 3 test cases for each problem. It explains how the problems and test cases will be formatted and presented to candidates. It also provides rules around submitting answers.

Uploaded by

satyajit101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Zonal Informatics Olympiad, 2024

Instructions to candidates

1. The question paper carries 80 marks, broken up into


four problems of 20 marks each. Each problem
has three Test Cases. If you solve all three Test
Cases correctly, you get 20 marks for that problem.
Otherwise, you get 5 marks for each Test Case that
you solve correctly.
2. All the 4 × 3 = 12 Test Cases appear as separate
Questions in the right panel (“Question Palette”).
The first three Questions correspond to the three Test
Cases of Problem 1, the next three correspond to the
three Test Cases of Problem 2 and so on.
A question icon turning green in the Question Palette,
does not mean that it is correct. It just denotes
that you have attempted it. All the questions will be
evaluated later.
3. Attempt all questions. There are no optional
questions.
4. There are no negative marks.
5. All expected answers are integers. Type in only the
integer. So, if your answer is “162”, enter only “162”.
Not “0162”, or “162.0”, etc.
6. Remember to save each answer. Only your final saved
answers will be considered.
7. Near the top-right corner, you should be able to see a
calculator icon. Clicking it pops up a calculator which
you may use.
Problem 1
There is a hidden array A1 , ...AN . There are 2N subsets of elements in this array. You are
given the sum of elements for each of these 2N subsets in a list S. You have to compute
A1 + A2 + . . . + AN .
Compute A1 + A2 + . . . + AN in each of the following cases.
(a) N = 3
S = [−5, −3, −2, 0, 0, 2, 3, 5]

(b) N = 6
S = [ 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14,
14, 14, 15, 15, 16, 16, 17, 17]

(c) N = 6
S = [ −19, −18, −16, −15, −14, −13, −12, −11, −11,
−11, −10, −10, −10, −9, −9, −8, −8, −7, −7,
−7, −6, −6, −6, −5, −5, −4, −4, −4, −3, −3,
−3, −3, −2, −2, −2, −2, −1, −1, −1, 0, 0, 1, 1, 1,
2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 10, 11, 13, 14]

2
Problem 2
There are N pillars, numbered 1 to N . Each pillar i has height Hi , and is composed of
Hi stone slabs stacked on top of each other.
A sequence of pillars is called beautiful if the height of each pillar is one more than
the height of the previous pillar. For example, [3, 4, 5, 6, 7], [10, 11, 12, 13] and [4, 5] are
beautiful sequences, while [6, 5, 4, 3], [2, 4, 7, 9] and [1, 2, 3, 5, 4] are not beautiful.
You can perform the following operations on a sequence:
• Add one stone slab to pillar i. That is, increase Hi by 1.
• Remove one stone slab from pillar i, provided this does not remove all stone slabs
from the pillar. That is, reduce Hi by 1 if Hi > 1.
For each of the following sequences of pillars, find the minimum number of operations
required to make the sequence beautiful.
(a) N = 3
H = [2, 4, 6]

(b) N = 12
H = [1, 2, 3, 1, 1, 5, 1, 3, 5, 3, 11, 11]

(c) N = 20
H = [ 12, 21, 13, 9, 19, 17, 15, 18, 22, 19,
17, 19, 15, 20, 24, 17, 35, 25, 25, 29]

3
Problem 3
N nodes, numbered 0 to N − 1, are connected by N − 1 edges to form a tree. In a tree,
you can reach any node j from any node i via a unique sequence of edges.
The edges are denoted by a matrix P = [p1 , p2 , . . . , pN −1 ] which says that node pi is
connected to node i. Thus, if N = 3 and P = [2, 0], the set of nodes is [0, 1, 2] and P
says that node 2 is connected to node 1 and node 0 is connected to node 2.
You are also given a sequence of N − 1 edge weights W . If we fix an assignment of these
N − 1 edge weights to the N − 1 edges, we can define the distance dist(i, j) between any
pair of nodes i and j as the sum of the edge weights on the unique path from i to j.
Given an assignment of weights to the edges, the total distance of the tree is the sum of
the pairwise distances between the nodes. Formally, the total distance is
X
dist(i, j)
0≤i<j≤N −1

.
Our goal is to compute the maximum total distance among all possible assignments of
the given weights to the edges. Compute this quantity in the following cases.
(a) N = 5
P = [0, 0, 0, 1]
W = [1, 1, 1, 1]

(b) N = 10
P = [0, 1, 2, 3, 4, 5, 6, 7, 8]
W = [10, 12, 2, 3, 6, 5, 8, 9, 11]

(c) N = 15
P = [0, 0, 0, 1, 1, 2, 3, 4, 0, 6, 6, 6, 11, 11]
W = [9, 8, 19, 5, 6, 2, 2, 4, 5, 20, 25, 11, 15, 13]

4
Problem 4
There are N balls, B1 , B2 , . . . , BN . Each ball Bi has a colour Ci . The colours are not
necessarily distinct. For instance, we could have 3 balls with colours [red, blue, red].
We can form 2N subsets of balls. A subset is considered good if the balls in the subset
can be arranged in a line in at least one way such that no pair of adjacent balls are of
the same colour.
In each of the following situations, compute the number of good subsets. The balls are
listed in the order [B1 , B2 , . . . , BN ] in terms of their colour.

Note: Any subset of size 0 and 1 is considered good.


(a) N = 4
C = [red, red, green, green]

(b) N = 8
C = [red, red, red, green, green, green, blue, blue]

(c) N = 20
C = [ red, green, green, green, blue, blue, blue,
yellow, yellow, yellow, yellow, yellow, yellow,
purple, purple, purple, purple,
purple, purple, purple]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy