ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT > задача:


50380 - Sum of the Numbers in the given Positions

Гость
• Вопросы к жюри (1)

Задачи сборника

• 250. 50448 - Paint Buckets
• 280. 50477 - Character Pyramids
• 50304 - Number Pattern
• 50492 - Contest Scoreboard
• 50322 - Snake Pattern
• 50321 - Missing Number
• 50445 - Cryptography
• 50410 - Zero Padding
• 50380 - Sum of the Numbers in ...
• 50400 - nth Row rth Element of a Table
• 50457 - The Number of Winners
• 50585 - Prodhimi i brendshem
• 50587 - Shnderrimi i numrit ne nje s...
• 030. 50737 - Sum of the k-largest n...
• 50419 - The longest bitonic sequence
• 50317 - Student Line Up
• 50311 - Student Line Up

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by Ibrahim Mesecan.

Sum of the Numbers in the given Positions

Question:
Write a program that calculates sum of the numbers in the given positions.

Input specification
There will be 4 lines of data. You will be first given the size of the positions array (n). Then, the following line will have n integers which is an ordered list in increasing order and 0 < n ≤ 3000. The third line will give the size of the number array (m) where 0 < m ≤ 5000 and The last line will have m integers between -30000 and 30000.
Note: The positions start from 1 and goes until m.

Output specification
Show one integer number: Sum of the Numbers in the given Positions.

Sample Input I   
5
2 5 7 9 10
10
1 8 7 5 17 15 6 7 19 12
Sample Output I   
62


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

www.contester.ru