|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
| Case 5 |
1 sec |
32 MB |
| Case 6 |
1 sec |
32 MB |
Description
Implement a Vector class that support n-dimensional vector dot product.
Your task is to complete
- const int operator[](int index) const;
- int operator*(const Vector& a);
inside the Vector class;
Remember to #include "function.h"!
Input
First line of input is an integer m, where m is the number of testcases.There are m testcases following.
A testcases consists of three lines:
- In the first line of each testcase, there are a string OP and an integer n, where OP is the operation and n is the vector size.
- In the second line of each testcase, there are n integers, representing all the elements inside the first vector, A.
- In the third line of each testcase, there are n integers, representing all the elements inside the second vector, B.
It is guaranteed that:
- 1 ≤ n, m ≤ 100
- For all the elements x in vector A and B, |x| ≤ 100
Output
For each testcase, according to its operation, output the result of A*B. There is a space after every number.
Partial Judge Code
11933.cpp
Partial Judge Header
11933.h
Tags