American Computer Science League
2019-2020 Contest #4
JUNIOR DIVISION
1. Graph Theory 1.
How many 1’s are in the adjacency matrix for this directed graph?
2. Graph Theory 2.
How many cycles are there from vertex A in the directed graph?
3. Digital Electronics 3.
Simplify the Boolean expression represented by the following digital
circuit.
4. Digital Electronics 4.
How many ordered quadruples make the following digital circuit TRUE?
5. What Does This Program Do? - Strings 5.
How many unique letters are in the output of the following program?
A = “HARTFORDISTHEINSURANCECAPITALOFTHEWORLD”
for i = 0 to len(A) - 1
if A[i] <= "H" then
B = B + A[i]
end if
if A[i] >= "P" then
C = C + A[i]
end if
next i
for i = 0 to len(B) - 1
if B[i] != “A” && B[i] != “E” then
D = D + B[i]
end if
next i
for i = 0 to len(C) - 1
if C[i] != “R” && C[i] != “T” then
E = E + C[i]
end if
next i
if len(D) <= len(E) then
for i = 0 to len(D) - 1
F = F + D[i] + E[i]
next i
else
for i = 0 to len(E) - 1
F = F + D[i] + E[i]
next i
end if
print F
end