HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2011-04-2. 50585 - Inner Product

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 50326 - Matrix Operations
• 50325 - How much time passed?
• 50776 - The number of different pa...
• 50779 - The shortest path in a maze
• 2011-04-1. 50586 - Prime Palindromes
• 2011-04-2. 50585 - Inner Product
• 2011-04-3. 50587 - Modular Convers...
• 2011-05-1. 50767 - Censor
• 2011-05-2. 50652 - Prime Factorization
• 2011-05-3. 50653 - Long Divide
• 2011-11-1. 50565 - Binary numbers
• 2011-11-3. 50588 - Processing the li...
• 2012-02-2. 50577 - Perfect Numbers...
• 2012-02-4. 50594 - Transformations

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Inner Product

Shqip
Write a program for the Inner product. The program returns (also called the "dot product" or "scalar product") Inner Product of the first n elements of "a" with the first n elements of "b". This is defined as the sum of the products of corresponding terms. For example, if "a" is the array {2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9} and "b" is the array {4.0, -3.0, 2.0, -1.0, 0.0, 0.0, 0.0, 0.0} , then the call innerProduct(a,8,b) would return:
(2.2)(4.0) + (3.3)(-3.0) + (4.4)(2.0) + (5.5)(-1.0) + 0 + 0 + 0 + 0 = 2.2 .

Input specification
The first line will contain a number: n, the number of numbers in the arrays where 1 < n ≤ 1000. The second and third lines will have n (space separated) floating point numbers where each number in the arrays are in the range: -10000.00 ≤ ai , bi ≤ 10000.00

Output specification
Show a floating point number with one decimal that represents the inner product of the arrays.

Input I
5
-4.0 3.8 6.0 -7.8 6.2
5.0 2.0 3.2 0.0 0.0
Output 1
6.8

Для отправки решений необходимо выполнить вход.

www.contester.ru