1063. 计算谱半径(20)
来源:互联网 发布:韩国主播用什么软件 编辑:程序博客网 时间:2024/04/28 04:40
1063. 计算谱半径(20)
时间限制
200 ms
内存限制
65536 kB
代码长度限制
8000 B
判题程序
Standard
作者
CHEN, Yue
在数学中,矩阵的“谱半径”是指其特征值的模集合的上确界。换言之,对于给定的n个复数空间的特征值{a1+b1i, ..., an+bni},它们的模为实部与虚部的平方和的开方,而“谱半径”就是最大模。
现在给定一些复数空间的特征值,请你计算并输出这些特征值的谱半径。
输入格式:
输入第一行给出正整数N(<= 10000)是输入的特征值的个数。随后N行,每行给出1个特征值的实部和虚部,其间以空格分隔。注意:题目保证实部和虚部均为绝对值不超过1000的整数。
输出格式:
在一行中输出谱半径,四舍五入保留小数点后2位。
输入样例:50 12 0-1 03 30 -3输出样例:
4.24
#include <iostream>#include <vector>#include <stdio.h>#include <algorithm>#include <iomanip>#include <string>#include <cmath>using namespace std;int main(){ int N; cin>>N; int max = 0; int a,b,sum; for(int i=0;i<N;i++){ cin>>a>>b; sum = a*a+b*b; if(sum>max){ max = sum; } } printf("%.2f",sqrt(max)); return 0;}
0 0
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063.计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- 1063. 计算谱半径(20)
- spring注解的使用
- 1057. 数零壹(20)
- fromdata上传数据
- 1061. 判断题(15)
- lua和c互调 参数传递
- 1063. 计算谱半径(20)
- Ensemble learning algorithms(Bagging, Boosting, Random Foreast)
- 1064. 朋友数(20)
- C#Virtual方法(虚方法)、Abstract方法(抽象方法)、Interface的区别
- mq 报2018错误
- 历届试题 地宫取宝 蓝桥杯
- Windows使用Git
- 【面试题2】实现Singleton模式
- [BZOJ4310]跳蚤 后缀数组+线段树