#CCBCHBAHAI0000124. Mảng cục bộ chưa khởi tạo (Uninitialized Local Array)
Mảng cục bộ chưa khởi tạo (Uninitialized Local Array)
Uninitialized Local Array
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
A local integer array with elements is created without an initializer. Initially, no element is considered to contain a defined value that the program may use.
Then assignments are performed. Each assignment gives an index and a value , meaning . An element assigned at least once becomes defined; if the same index is assigned multiple times, the latest value is kept.
Finally, element reads are requested. For each requested index, print its current value if it has been assigned. If it has never been assigned, do not read or guess its value; print INDETERMINATE instead.
Input
- The first line contains and .
- Each of the next lines contains and , representing the assignment .
- The next line contains .
- The final line contains exactly indices to inspect.
Every input index lies in .
Output
For each requested index, print one line containing either its current assigned value or INDETERMINATE if it has never been assigned.
Subtasks
Subtask 1 (100 points): , , , .
Examples
Input
6 3
0 7
2 -4
5 9
6
0 1 2 3 4 5
Output
7
INDETERMINATE
-4
INDETERMINATE
INDETERMINATE
9
Explanation
The array has elements. The assignments define , , and .
The queries inspect indices . Only indices have been assigned, so the other positions must be reported as INDETERMINATE instead of reading an uninitialized value.