Compute the L2 norm of a vector
EasyProblem Description
Given a list of numbers, compute its L2 (Euclidean) norm: sqrt(sum(x_i^2)).
Input: One line of space-separated numbers.
Output: The L2 norm (a single number). Round to 2 decimal places for comparison.
Example:
- Input:
3 4 - Output:
5.0(sqrt(9+16) = 5)
Input & Output Format
INPUT:
Two lines. First line: space-separated numbers for vector a.
Second line: space-separated numbers for vector b.
Second line: space-separated numbers for vector b.
OUTPUT:
A single number (the dot product).
Example
Input:
1 2 3
4 5 6
4 5 6
Output:
32
Explanation: 1×4 + 2×5 + 3×6 = 4 + 10 + 18 = 32
Loading editor...
Output
Run or submit to see output.