Professional Documents
Culture Documents
Hkico-python Đề 9
Hkico-python Đề 9
Hkico-python Đề 9
Đề thi Vòng chung kết quốc gia năm học 2019 – 2020
A. Aesthetic consideration
B. The code would not executed without this definition
C. Prevent main() from being executed when imported as module
D. It is a programming convention as main() also presented in other languages like
C/C++ or Java
E. None of the above
3. Does the following code have errors during execution? If so, what is it?
56
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
4. What is the expected output of the following code?
A.
B.
C.
D.
E. None of the above
A. abcd
B. dbce
C. edcb
D. dcea
E. None of the above
57
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
7. The following code produces runtime error,
8. What could be filled in place of line 4 in the following code (indicated with comments) so
that the expected output is ?
A.
B.
C.
D.
E. None of the above
58
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
Refer to the following code for question 9 to 11:
I.
II.
III.
IV.
59
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
9. Which implementation is fastest?
A. I
B. II
C. III
D. V
E. They have the same performance
11. Implementation I doesn’t use for-loop, implementation II doesn’t use if, implementation
III doesn’t invoke itself, implementation IV invoke itself once in each iteration. Which of
the following is a correct statement?
A. Implementation without for-loop is always the fastest
B. Implementation with less memory usage is always the fastest
C. Shorter the implementation, faster the execution
D. Recursion is always the fastest
E. None of the above
A.
B.
C.
D.
E.
60
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
Refer to the following code for question 13 to 15:
13. Which of the following is a correct statement describing the relationship of class A, B and
C?
A. Class A inherits class B and C and invoking initializer of parent class B
B. Class B and C inherits class A and both class implicitly invoke initializer of class A
C. Class C is a subclass of class B and both are subclass of class A
D. The code is not correct and would produce syntax error
E. None of the above
B.
C.
61
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
15. What is “c” in line 8 is? And “self.c” in line 10?
A. Empty variable, integral variable
B. Class variable, instance variable
C. Member variable, constructor variable
D. The code is not correct syntax-wise
E. None of the above
A.
B.
C.
D.
E. None of the above
17. Expression in line 8 evaluates to? If False, what is the reason they are
not equal?
A. True
B. False, new list instances are created (and returned) each time func is invoked
C. False, variable i is modified between two func call so the values in the list are not the
same
D. The code would result in runtime error
E. None of the above
62
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
18. What is the value of b in line 11?
A.
B.
C.
D.
E. None of the above
A.
B.
C.
D. All of the above
E. None of the above
20.
Given the code: And its output:
What is the value of the expression ? If False, what is the appropriate reason?
A. True
B. False, list a is consumed but b is not, because list a is not explicit
C. False, every instance of list does not equal (evaluate to True) in case of ‘==’ operator
D. False, values of elements are not equal in list a and b, they appear to be the same
when printed out
E. None of the above
63
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
ĐÁP ÁN THAM KHẢO
ĐỀ SỐ 1
Câu Đáp án Câu Đáp án Câu Đáp án Câu Đáp án
1 C 6 C 11 D 16 E
2 A 7 A 12 C 17 A
3 B 8 C 13 A 18 C
4 B 9 C 14 B 19 C
5 A 10 A 15 A 20 B
ĐỀ SỐ 2
Câu Đáp án Câu Đáp án Câu Đáp án Câu Đáp án
1 D 6 B 11 A 16 C
2 D 7 C 12 C 17 A
3 B 8 C 13 D 18 C
4 E 9 D 14 A 19 D
5 B 10 B 15 A 20 B
ĐỀ SỐ 3
Câu Đáp án Câu Đáp án Câu Đáp án Câu Đáp án
1 D 6 E 11 E 16 C
2 A 7 C 12 B 17 C
3 C 8 D 13 A 18 B
4 A 9 D 14 D 19 D
5 E 10 B 15 A 20 C
ĐỀ SỐ 4
Câu Đáp án Câu Đáp án Câu Đáp án Câu Đáp án
1 B 6 C 11 D 16 C
2 C 7 D 12 A 17 E
3 D 8 C 13 A 18 D
4 C 9 C 14 D 19 B
5 D 10 E 15 D 20 D
64
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455
ĐỀ SỐ 5: Đề thi Vòng loại quốc gia năm học 2021 – 2022
Câu Đáp án Câu Đáp án Câu Đáp án Câu Đáp án
1 C 5 B 9 A 13 A
2 A 6 A 10 C 14 A
3 B 7 C 11 D 15 E
4 B 8 E 12 D 16 A
ĐỀ SỐ 6: Đề thi Vòng chung kết quốc gia năm học 2021 – 2022
Câu Đáp án Câu Đáp án Câu Đáp án Câu Đáp án
1 B 6 B 11 A 16 C
2 A 7 C 12 E 17 B
3 B 8 A 13 E 18 E
4 A 9 D 14 D 19 B
5 D 10 C 15 D 20 E
ĐỀ SỐ 8: Đề thi Vòng chung kết quốc gia năm học 2020 – 2021
Câu Đáp án Câu Đáp án Câu Đáp án Câu Đáp án
1 C 6 E 11 C 16 A
2 A 7 D 12 B 17 B
3 D 8 D 13 E 18 B
4 B 9 B 14 A 19 E
5 A 10 D 15 C 20 C
ĐỀ SỐ 9: Đề thi Vòng chung kết quốc gia năm học 2019 – 2020
Câu Đáp án Câu Đáp án Câu Đáp án Câu Đáp án
1 C 6 B 11 B 16 B
2 E 7 C 12 C 17 A
3 E 8 C 13 E 18 C
4 B 9 B 14 E 19 D
5 D 10 C 15 E 20 D
65
KỲ THI OLYMPIC TIN HỌC QUỐC TẾ HKICO (HongKong International Computational Olympiad)
FERMAT Education: Số 6A1 tiểu khu Ngọc Khánh, Ba Đình, Hà Nội – 0961 603 003 / 0917 830 455