传送门

冷静分析容易发现,我们只要能确定一个数的值,所有值也就可以确定了

确定一个数的值很容易,$a_ia_j=M_{i,j},a_ia_k=M_{i,k},a_ja_k=M_{j,k}$

然后就可以得到 $a_i=\sqrt {M_{i,j}*M_{j,k}/M_{j,k}}$ ,然后这一题就做完了

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
typedef long long ll;
inline ll read()
{
ll x=,f=; char ch=getchar();
while(ch<''||ch>'') { if(ch=='-') f=-; ch=getchar(); }
while(ch>=''&&ch<='') { x=(x<<)+(x<<)+(ch^); ch=getchar(); }
return x*f;
}
const int N=;
ll n,m[N][N],a[N];
int main()
{
n=read();
for(int i=;i<=n;i++)
for(int j=;j<=n;j++) m[i][j]=read();
a[]=sqrt(1ll*m[][]*m[][]/m[][]);
for(int i=;i<=n;i++) a[i]=m[][i]/a[];
for(int i=;i<=n;i++) printf("%lld ",a[i]); puts("");
return ;
}

Codeforces 1220B. Multiplication Table的更多相关文章

  1. codeforces D. Multiplication Table

    http://codeforces.com/contest/448/problem/D 题意:一个n×m的矩阵,a[i][j]=i*j; 然后把a数组排序,找出第k个数. 思路:1-n×m二分枚举,然 ...

  2. Codeforces 577A - Multiplication Table

    Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i ...

  3. CodeForces 577A Multiplication Table 质因子数

    题目:click here 题意:看hint就懂了 分析:数论小题,在n0.5时间里求n的质因子数 #include <bits/stdc++.h> using namespace std ...

  4. Codeforces Codeforces Round #319 (Div. 2) A. Multiplication Table 水题

    A. Multiplication Table Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/57 ...

  5. Codeforces Round #256 (Div. 2) D. Multiplication Table(二进制搜索)

    转载请注明出处:viewmode=contents" target="_blank">http://blog.csdn.net/u012860063?viewmod ...

  6. Codeforces Round #586 (Div. 1 + Div. 2) B. Multiplication Table

    链接: https://codeforces.com/contest/1220/problem/B 题意: Sasha grew up and went to first grade. To cele ...

  7. Codeforces Round #256 (Div. 2) D. Multiplication Table 二分法

     D. Multiplication Table time limit per test 1 second memory limit per test 256 megabytes input st ...

  8. Codeforces 448 D. Multiplication Table

    二分法判断答案 D. Multiplication Table time limit per test 1 second memory limit per test 256 megabytes inp ...

  9. Codeforces 448 D. Multiplication Table 二分

    题目链接:D. Multiplication Table 题意: 给出N×M的乘法矩阵要你求在这个惩罚矩阵中第k个小的元素(1 ≤ n, m ≤ 5·10^5; 1 ≤ k ≤ n·m). 题解: n ...

随机推荐

  1. Misplaced alignment tab character &

    范例: 期望的标题效果:Literature review & Research set-up 在Latex里写的标题:\section{Literature Review & Res ...

  2. 套接字之select系统调用

    select是IO多路复用的一种方式,用来等待一个列表中的多个描述符的可读可写状态: SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_ ...

  3. LeetCode 60. 第k个排列(Permutation Sequence)

    题目描述 给出集合 [1,2,3,…,n],其所有元素共有 n! 种排列. 按大小顺序列出所有排列情况,并一一标记,当 n = 3 时, 所有排列如下: "123" "1 ...

  4. LeetCode 39. 组合总和(Combination Sum)

    题目描述 给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合. candidates 中的数字可以无限 ...

  5. HTML功能框架

    起始预定义函数 function $(obj) { return document.getElementById(obj); } 1.用户登陆框架 <!DOCTYPE html> < ...

  6. DataV数据可视化功能特性

    使用DataV制作实时销售数据可视化大屏 (本课程可以帮助数据分析师学习数据可视化大屏的制作,包括制作的方法.设计原则等基础知识,并提供一个微项目,使用数加的DataV基于ABC公司的经营数据,快速构 ...

  7. linux各种中文乱码解决办法整理

    2016年03月21日 15:52:05 阅读数:30812 远程登录服务器用vim在终端下编辑查看文件经常会遇见各种中文乱码问题.做如下设置可基本解决vim中文乱码问题 首先查看系统对中文的支持lo ...

  8. 【数据算法】Java实现二叉树存储以及遍历

    二叉树在java中我们使用数组的形式保存原数据,这个数组作为二叉树的数据来源,后续对数组中的数据进行节点化操作. 步骤就是原数据:数组 节点化数据:定义 Node节点对象 存储节点对象:通过Linke ...

  9. assert断言用法

    使用assert断言是学习python一个非常好的习惯,python assert 断言句语格式及用法很简单.在没完善一个程序之前,我们不知道程序在哪里会出错,与其让它在运行最崩溃,不如在出现错误条件 ...

  10. 【8】ie css hack

    1. "\9"   IE6/IE7/IE8/IE9/IE10都生效 "\0"   IE8/IE9/IE10都生效,是IE8/9/10的hack "\9 ...