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

Programming Olympiad 2024 Guidelines

The document outlines the rules and tasks for the Programming Olympiad 2024, including instructions for participants on how to submit answers and the scoring system for each question. It presents three programming tasks: calculating the number of black squares on a checkered board, determining a tree's growth speed based on its name, and encoding a player's sequence of attacks in a fighting game. Participants are reminded to follow specific guidelines to avoid disqualification.

Uploaded by

Abdur Rahman
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)
17 views2 pages

Programming Olympiad 2024 Guidelines

The document outlines the rules and tasks for the Programming Olympiad 2024, including instructions for participants on how to submit answers and the scoring system for each question. It presents three programming tasks: calculating the number of black squares on a checkered board, determining a tree's growth speed based on its name, and encoding a player's sequence of attacks in a fighting game. Participants are reminded to follow specific guidelines to avoid disqualification.

Uploaded by

Abdur Rahman
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

IITPSA NPC

Level 1 West, Gallagher House,


Gallagher Convention Centre,
Leading ICT Professionalism 19 Richards Drive, Midrand, South Africa
and Ethical Digital P O Box 1714, Halfway House
1685, South Africa
Transformation
Tel: +27 87 655 1679 or
+27 11 315 1319
[Link]

Programming Olympiad 2024 : Round 1


Not to be used before 29 July 2024

1. This paper is for ALL participants.


2. All answers must be TYPED or PASTED on your Answer Sheet.
3. Online participants should place their answers in the correct space provided on the competition website (URL) they
received with their username and password.
4. Each correct answer for question 1 earns 7 marks, question 2 earns 8 marks while a correct answer for question 3
earns 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, and the language and version used in a comment statement at the start
of every program, e.g., “Q3 Sam King, Python 2.7”
8. Save your program as Qn Name Surname, e.g., Q3 Sam King
9. You may assume that the user input will satisfy the problem specification and so you do not need to validate the
input.
10. Do not write code to produce only specific answers, as the external judges may use other test cases.
11. After the contest you may be given time to print out your Answer Sheet. Do not make any changes during this time.
12. Make sure you save the programs you have created as well as the Answer Sheet in a place where your teacher can
find them.
13. DO NOT MODIFY ANY FILES AFTER THE END OF THE CONTEST AS THIS WILL LEAD TO YOUR DISQUALIFICATION.

Question 1: Checkered Board Task


Chess, Checkers and many other games are played on an 8 Write a program that reads in the checkered board's side
by 8 checkered board. Many other games can be played on length S as input. Your program must output the number of
boards of different sizes. black squares on a S by S checkered board. Assume the top
right square of the board is always black.
Examples
Input: 5
Output 13
Input: 8
Output: 32

Figure 1. 5 by 5 checkered board

Directors: Ms. S.B. Goba (President), Ms. P. Pasi (VP), K.W. Matthee (Treasurer),
.Gwanzura, T. Mashegoane, R. Kisten, , J. Singh, K.F. Chipidza,
Prof. L.A. Futcher, Ms. J.M. Overdevest, N.V. Zambezi, M.A. Parry (CEO)
Sponsored by
Reg. No.: 1958/001036/08 VAT Reg. No.: 4760 12 1113 PBO No.: 930010177
Test your program with the following cases: Question 3: Fighting Game
1.a 10 Introduction:
1.b. 21 In a fighting game, the buttons A, B, X, Y are used to perform
1.c. 36 different types of attacks. Pressing a button once performs a
1.d. 111 normal attack, and pressing the same button twice performs
a special attack. For example, pressing X is a punch and XX
is a special punch.
Question 2: Tree Growth
In a virtual forest, a tree’s name determines its growth speed.
The player inputs a sequence of attacks e.g. “ABXXYBB”
Each letter in the tree’s name is assigned a value as follows:
which is then sent to the game engine. The game engine
• Vowels (a, e, i, o, u) are 5 points each.
• Special consonants (b, c, d, f, g) are 3 points each. cannot directly read the players inputs. Instead, it reads an
• All other consonants are 2 points each. encoded version where special attacks are represented by
the letter S followed by the attack type. The sequence

The sum of these points determines the tree’s growth speed “ABXXYBB” is encoded as “ABSXYSB”.

as follows:
Sum Points Growth speed Player’s often spam (hit the same button repeatedly). To

Less than 25 Slow discourage spamming, if the player repeatedly hits the same

25 to 35 Medium button consecutively, it is interpreted as a single special


attack e.g. “XXXXXB” is encoded as “SXB”.
Greater than 35 Fast

Task Task:
Write a program which reads in the name of the tree and Write a program which reads in the player's sequence of
outputs the tree’s growth speed. attacks and outputs the encoded version sent to the game
engine.
Examples:
Input: baobab Examples:
Output: Slow Input: XABYYX
Output: XABSYX
Explanation: The sum points of baobab is 3 + 5 + 5 + 3 + 5 +
3 = 24. Since 24 is less than 25 the growth speed is Slow.
Input: XXXXBYYYAA
Input: pineapple Output: SXBSYSA
Output: Medium
Tests
Explanation: The sum points of pineapple is 2 + 5 + 2 + 5 + 3.a. BBBBA
5 + 2 + 2 + 2 + 5 = 30. Since 30 is in the range 25 to 35 the 3.b. XBAYYABX
growth speed is Medium.
3.c. AABBXYXYBAAABBXYXYBA
3.d.
Test your program with the following cases: AAAAABAAAXBAABBXXXXXXYBBBBYYYYAAAXXXXYXXXXX
2.a. oak BBBBAAAYBX
2.b. magnificent
2.c. sequoia
2.d. yellowwood

Directors: Ms. S.B. Goba (President), Ms. P. Pasi (VP), K.W. Matthee (Treasurer),
.Gwanzura, T. Mashegoane, R. Kisten, , J. Singh, K.F. Chipidza, Sponsored by
Prof. L.A. Futcher, Ms. J.M. Overdevest, N.V. Zambezi, M.A. Parry (CEO)
Reg. No.: 1958/001036/08 VAT Reg. No.: 4760 12 1113 PBO No.: 930010177

Common questions

Powered by AI

Providing explicit and varied input cases like those for the Checkered Board task ensures that participant submissions can be accurately evaluated against a range of test scenarios. This approach challenges participants to produce general solutions, rather than hardcoded outputs, by testing their programs against different instances. This format validates the correctness and robustness of the solutions, ensuring that they can handle diverse and edge-case inputs potentially encountered in real-world applications .

Requiring answers to be typed or pasted on an answer sheet ensures uniformity in the submitted responses, which facilitates easier evaluation and grading. It prevents issues related to handwriting legibility and eliminates variations in how answers are presented, allowing judges to focus solely on content accuracy. This standardization streamlines the judging process by mitigating potential errors or biases that could arise from non-standardized submissions, enhancing objectivity and efficiency in evaluation .

Top leadership roles such as President, Vice President, Treasurer, and CEO indicate a clear hierarchy and distribution of responsibilities within an organization. These positions reflect authority and accountability for strategic decision-making and operational management. The presence of clearly defined roles helps facilitate efficient decision-making and accountability within the organization, and it reflects a structured approach to governance, which is crucial for the effective implementation of policies and achievement of organizational goals .

Representing repeated actions by special symbols in the game's attack sequence encoding is an efficient method to compress input data, reducing redundancy and potentially improving processing speed. It simplifies the interpretation of sequences by using concise encodings rather than lengthy repetitive character inputs. This approach can effectively counteract gaming strategies reliant on rapid spam without departing significantly from intuitive player experience. However, it may also challenge players to adapt their play style to the encoded outputs and ensure that the input reflects intended gameplay actions, which necessitates a balance between compression and gameplay clarity .

The button sequence encoding in the fighting game discourages spamming by condensing consecutive button presses into a single special attack. When players hit the same button repeatedly, instead of reading each press individually, the game interprets this as a single special attack. For example, a sequence of 'XXXXX' is encoded as 'SXB'. This limits the effectiveness of spamming by not allowing multiple inputs to register as multiple attacks, thereby penalizing players who try to achieve more attacks through consecutive presses .

Prohibiting program modifications post-contest ensures that all entries are evaluated based on the work submitted within the designated competition time, preserving the integrity and fairness of the contest. This rule prevents participants from taking unfair advantage by modifying their solutions based on feedback or additional time, thus maintaining a level playing field. It ensures that all participant submissions reflect their capabilities under identical conditions, upholding the principle of fair competition .

Requiring participants to save their programs and answer sheets in specific formats helps ensure consistency and organization during the assessment process. It prevents errors in identifying participants' solutions and facilitates a smoother review by judges. Additionally, it ensures that programs can be easily accessed and evaluated without confusion regarding authorship or the content of the files. This practice minimizes administrative challenges and helps secure the integrity of the assessment process by preventing post-contest modifications .

VAT registration indicates that an organization is recognized by the government for the purpose of collecting and remitting Value Added Tax, highlighting its compliance with tax laws. The PBO (Public Benefit Organization) number signifies that the organization is recognized as serving public interest and may entitle it to tax exemptions or rebates. These numbers reflect the organization's legal and financial responsibilities and commitments, ensuring transparency and compliance with regulatory requirements which are essential for legitimacy and trustworthiness .

The growth speed of a tree is determined by calculating a sum of points based on the characters in the tree's name. Vowels are assigned 5 points each, special consonants (b, c, d, f, g) are assigned 3 points each, and all other consonants are assigned 2 points each. The total sum of these points categorizes the tree's growth speed as follows: less than 25 points results in 'Slow', 25 to 35 points in 'Medium', and greater than 35 points in 'Fast' .

The role of input validation is typically to ensure that the inputs provided to a program meet the expected criteria to prevent errors and ensure correct program execution. However, in this programming competition, input validation is not required because participants are explicitly told they may assume that the user input will satisfy the problem specification. This implies that the organizers ensure that only valid inputs are used to test the programs, thereby simplifying the task for participants by allowing them to focus entirely on implementing the solutions rather than handling potential input errors .

You might also like