Codeforces Round #230 (Div. 2)B. Three matrices
来源:互联网 发布:caffe 用训练好的模型 编辑:程序博客网 时间:2024/04/29 17:49
题目连接:http://codeforces.com/problemset/problem/393/B
#include <cstdio>#include <cstring>double w[171][171];double a[171][171];double b[171][171];int n;int main(){ int i,j; while(~scanf("%d",&n)) { memset(w,0,sizeof(w)); memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); for(i=1;i<=n;++i) { for(j=1;j<=n;++j) { scanf("%lf",&w[i][j]); } } for(i=1;i<=n;++i) { for(j=i;j<=n;++j) { a[i][j]=(w[i][j]+w[j][i])/2; a[j][i]=a[i][j]; b[i][j]=w[i][j]-a[i][j]; b[j][i]=b[i][j]-(2*b[i][j]); } } for(i=1;i<=n;++i) { for(j=1;j<=n;++j) { if(j==1) printf("%.8lf",a[i][j]); else printf(" %.8lf",a[i][j]); } printf("\n"); } for(i=1;i<=n;++i) { for(j=1;j<=n;++j) { if(j==1) printf("%.8lf",b[i][j]); else printf(" %.8lf",b[i][j]); } printf("\n"); } } return 0;}
0 0
- Codeforces Round #230 (Div. 2)B. Three matrices
- Codeforces Round #230 (Div. 2)B. Three matrices
- codeforces--2014/2/20--B. Three matrices
- Codeforces 393B Three matrices(数论)
- Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 2) B. Bear and Three Musketeers(STL_暴力)
- Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 2)B Bear and Three Musketeers
- Codeforces Round #277.5 (Div. 2) F. Special Matrices
- Codeforces Round #277.5 (Div. 2)-F. Special Matrices
- Codeforces Round #318 (Div. 2) B. Bear and Three Musketeers 位运算压缩
- CF#230 B题 Three matrices
- Codeforces Round #322 (Div. 2) D. Three Logos
- Codeforces Round #327 (Div. 2)E. Three States
- Codeforces Round #322 (Div. 2) D. Three Logos(暴力)
- Codeforces Round #230 (Div. 1)B,C
- Codeforces Round #131 (Div. 2) A B
- Codeforces Round #134 (Div. 2)B. Airport
- Codeforces Round #170 (Div. 2) problem B
- Codeforces Round #173 (Div. 2) Problem B
- mysql 开启慢查询
- 知识管理软件要用哪款呐
- kindeditor不自动过滤html
- Leetcode: Best Time to Buy and Sell Stock III
- Codeforces Round #230 (Div. 2) A. Nineteen
- Codeforces Round #230 (Div. 2)B. Three matrices
- CF #230 (Div. 2) A
- JavaBean 反射机制实现自动配置数据
- CF #230 (Div. 2) B
- linux下使用C多线程网络库xs
- C++ 适配器
- 393高校毕业设计选题
- 关于hibernate.cfg.xml头文件DTD的引入
- 锐角三角形占百分之几