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

Разделы > Linear Data Structures: Arrays > задача:


51095 - Normal and Trace

Задачи раздела

• 51116 - The Star Triangle
• 51043 - Genome Sequencing
• 51042 - The most frequent k-mer
• 51165 Question 1
• 51171 Question 3
• 51175 Question 2
• 51093 - rgb2gray
• 51092 - Even and Odd
• 51095 - Normal and Trace
• 50382 - Parkside's Other Triangle
• 50383 - Noisy Mornings
• 51097 - Sum of Borders
• 51129 - Hexagon
• 51246 - Swap largest word, reverse ...
• 50431 - Sultan's Game
• 50420 - Teachers Sightseeing
• 50977 - Gaussian Elimination

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
bfs.

Normal and Trace

Question: Given a 2D square matrix, the task is to find Normal and Trace  of matrix.

Normal of a matrix is defined as square root of sum of squares of matrix elements.

Trace of a n x n square matrix is sum of diagonal elements

 

Input specification: In the first line you will be given one integer number (1<=n<=500)  the dimension of matrix, then in following n lines you will be given a square matrix size of n by n, where each element of matrix is in reange 1 to 100

 

Output specification: Show Normal with two digits after the floating point and Trace of matrix .

Sample Input I 

3
6 3 2
5 2 4
1 2 4

Sample Output I

10.72 12

 Sample Input I Explanation

 
Normal= sqrt(6*6+3*3+2*2+5*5+2*2+4*4+1*1+2*2+4*4)=10.72
Trace=6+2+4=12
Для отправки решений необходимо выполнить вход.

www.contester.ru