#C59. Normalize Execution Times
Normalize Execution Times
Normalize Execution Times
You are given m submissions from a coding competition. Each submission is described by a string with four fields: the submission ID, the programming language used, the execution time (in milliseconds), and its time complexity. Your task is to normalize the execution time into nanoseconds, i.e. convert the time by using the following formula:
\(\text{norm\_time} = \text{time} \times 10^6\)
Then, output the normalized submission details with the submission ID, the normalized execution time, and the time complexity. All inputs and outputs are given via standard input and standard output respectively.
inputFormat
The first line of input contains an integer m, the number of submissions. This is followed by m lines, each containing a submission details string with the format:
id_i lang_i time_i complexity_i
Where time_i
is an integer representing the execution time in milliseconds.
outputFormat
Output m lines. Each line should contain the normalized submission details in the format:
id_i norm_time_i complexity_i
Where norm_time_i
is obtained by multiplying time_i
by \(10^6\) (i.e. converting milliseconds to nanoseconds).
3
sub001 Python 123 O(1)
sub123 JavaScript 45 O(log(n))
sub789 C++ 1000000 O(n^2)
sub001 123000000 O(1)
sub123 45000000 O(log(n))
sub789 1000000000000 O(n^2)
</p>