/ /

记录详情

Accepted


  
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 1ms 384.0 KiB
#2 Accepted 2ms 320.0 KiB
#3 Accepted 1ms 384.0 KiB
#4 Accepted 1ms 384.0 KiB
#5 Accepted 2ms 384.0 KiB
#6 Accepted 1ms 384.0 KiB
#7 Accepted 1ms 384.0 KiB
#8 Accepted 1ms 384.0 KiB
#9 Accepted 1ms 384.0 KiB
#10 Accepted 1ms 384.0 KiB
#11 Accepted 1ms 384.0 KiB
#12 Accepted 1ms 384.0 KiB
#13 Accepted 1ms 384.0 KiB
#14 Accepted 2ms 384.0 KiB
#15 Accepted 1ms 384.0 KiB
#16 Accepted 1ms 384.0 KiB
#17 Accepted 1ms 384.0 KiB
#18 Accepted 1ms 384.0 KiB
#19 Accepted 2ms 384.0 KiB
#20 Accepted 1ms 384.0 KiB

代码

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
int n,sum=0;
cin>>n;
int a[n][n],i,j,b,c,l[n][n];
for(i=0;i<n;i++)
{
	for(j=0;j<n;j++)
	{
		cin>>a[i][j];
		l[i][j]=a[i][j];
	}
}
for(b=0;b<n;b++)
{
for(c=0;c<n;c++)
{
	sum=0;
for(i=0;i<n;i++)
{
	sum+=l[b][i];
}
for(j=0;j<n;j++)
{
	sum+=l[j][c];
}
sum-=(2*l[b][c]);
a[b][c]=sum;
}
}
for(b=0;b<n;b++)
{
	for(c=0;c<n;c++)
	{
		cout<<a[b][c]<<" ";
	}
	cout<<endl;
}
}

信息

递交者
类型
递交
题目
P1015 矩阵变换
题目数据
下载
语言
C++
递交时间
2021-08-11 20:19:03
评测时间
2021-08-11 20:19:03
评测机
分数
100
总耗时
38ms
峰值内存
384.0 KiB