0% found this document useful (0 votes)
8 views1 page

2013 C 1 JR Sol

The document provides solutions for the American Computer Science League Junior Division Contest #1 for the year 2012-2013. It includes recursive function calculations, computer number system conversions, and an analysis of a program's output. Key results include values of 32, 55, and 9 from various problems presented in the contest.

Uploaded by

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

2013 C 1 JR Sol

The document provides solutions for the American Computer Science League Junior Division Contest #1 for the year 2012-2013. It includes recursive function calculations, computer number system conversions, and an analysis of a program's output. Key results include values of 32, 55, and 9 from various problems presented in the contest.

Uploaded by

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

ACSL

2012 - 2013 American Computer Science League Contest #1


Junior Division Solutions

1. Recursive Functions
(100) = (50) + 1 = 31 + 1 = 32 1. 32
(50)= (25) +1 = 30 + 1 = 31
(25)= 25+5= 30 Now substitute backwards.

2. Recursive Functions 2. 55
(1,10) = (2,8) + 1 = 54 + 1 = 55
(2,8) = (3,6) + 1 = 53 + 1 = 54
(3,6) = (4,4) + 1 = 52 + 1 = 53
(4,4) = 2* (6,2) = 2*26 = 52
(6,2)=3*6 + 4*2 = 26 Now substitute backwards.

3. Computer Number Systems 3. 31C216 or 31C2


It is easier to do the calculations in hex. From right to left,
borrowing when necessary yields:
F–D =2
1A – E = C
D–C=1
D–A=3

4. Computer Number Systems 4. 1753168 or 175316


FACE16 = 1111 1010 1100 11102
= 1 111 101 011 001 1102
= 1 7 5 3 1 68

5. What Does This Program Do? 5. 9


The table contains the values of a, b, c, d and e after each line.
Do we need one more
a b c d e line: 20 5 2 4 16 for
20 5 2 4 16 “if e>a then a = a – e?
20 10 2 4 16
20 20 2 4 16
2 20 2 4 16

(c+d)/a-b/a+e =(2 + 4)/2 – 20/2 + 16 = 9

You might also like