0% found this document useful (0 votes)
32 views2 pages

2021 PO R1 Question Paper Eng

The document provides instructions for participants in the Programming Olympiad 2021 Round 1 competition. It outlines that participants will have 60 minutes to attempt multiple choice and coding questions. It provides guidance on formatting responses, assumptions about inputs, testing procedures, and policies regarding accessing external resources. Results will be provided to schools by August 25th.

Uploaded by

Lesego Wubet
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)
32 views2 pages

2021 PO R1 Question Paper Eng

The document provides instructions for participants in the Programming Olympiad 2021 Round 1 competition. It outlines that participants will have 60 minutes to attempt multiple choice and coding questions. It provides guidance on formatting responses, assumptions about inputs, testing procedures, and policies regarding accessing external resources. Results will be provided to schools by August 25th.

Uploaded by

Lesego Wubet
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/ 2

Programming Olympiad 2021: Round 1

Not to be used before 16 August 2021

1. This paper is for ALL participants.


2. All answers (output) must be written on the given answer sheet by offline participants.
3. All answers (output) must be submitted on the competition website that you received with your login
(online participants).
4. Each correct answer for question 1, question 2 (a) and (b) and question 3 earns eight (8) marks while
each correct answer for question 2 (c) and (d) earns ten (10) marks.
5. You have 60 minutes to attempt as many questions as possible.
6. Programs should be readable, concise, and use appropriate variable names.
7. Indicate the question, your name, surname, username and the language and version used in a
comment statement at the start of every program, e.g. “Q3 Sam King, username, Python 2.7”
8. You may assume that the user input will satisfy the problem specification and so you do not need to
validate the input.
9. Do not write code to produce only specific answers, as the external judges may use other test cases.
10. Make sure you upload your programs before you log off, and as an extra precaution, save the
programs you have created in a place where your teacher can find them.
11. DO NOT MODIFY ANY FILES AFTER THE END OF THE CONTEST AS THIS WILL LEAD TO YOUR
DISQUALIFICATION.
12. USE OF OTHER WEBSITES: Any attempt to access any other website or source of information during
the competition will disqualify you.
13. Results will be sent to schools by 25 August.

Question 1 – Determinant
Test your program with the following cases:
Give your answer as a number only with no spaces, e.g.
Kevin, a university student, is struggling with his
1234
mathematics homework and can’t find his calculator.
Help him find the correct answers for the following
mathematical operation. 1a) 4 -2 6 3
Given as input 4 space-separated integers a b c d, write 1b) 6 7 7 7
a program to output the value ad – bc. The value of each
integer is between -10000 and 10000. 1c) 78 21 43 65
1d) 9999 -400 173 77

Example: 4 5 2 3
Answer: 2 (4*3 – 5*2)
Question 3 – Carpet
Question 2 – Sum of Series
Aladdin has decided that being a prince is overrated, and
Write a program to determine the sum of the first n so has opened an online carpet shop.
terms of the following series: In Aladdin's shop the price of a carpet depends on the
length of the carpet and the number of different colours
used. In his computer system, a carpet is represented by
1/2 + 2/3 + 3/4 + 4/5 + 5/6 + …, where n is between 1
a string of letters, e.g., zbbcbbx, where each character
and 10000. Output the answer rounded off to 2 decimal
represents the colour of a fixed stretch of carpet. Note
places.
that the total length of the string would be the same as
Note: A value between 0.005 and 0.009 rounds off to the total length of the carpet. Ultimately, the price of a
0.01, while a value between 0.001 and 0.004 rounds off carpet is the length of the carpet multiplied by the
to 0.00. For this question only, your program does not number of different colours used.
have to do the rounding; you may round off by hand.
Write a program that, when given a string representing
Example: n = 4 a carpet, outputs its price.
Answer: 2.72 (rounded off from 2.716666)
Example: abacx
Answer: 20 (length 5 multiplied by 4 different types)

Test your program with the following cases: Give


your answer as a number only with no spaces, e.g. 1234 Test your program with the following cases:
(each case should be input as a single line)
2a) n = 2 Give your answer as a number only with no spaces, e.g.
2b) n = 10 1234
2c) n = 9999
2d) n = 10000 3a)qiraat
3b)cdefghijklmnopqrstuwxyz
3c)warrior
3d)supercalifragilisticexpialidocious

You might also like