Submission #58762983
Source Code Expand
#include <bits/stdc++.h>
#include<atcoder/all>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using namespace atcoder;
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<ll,ll> P;
constexpr ll mod=1000000009;
int a[2005][2005];
int sh[2005],sw[2005];
int main(){
int h,w;cin>>h>>w;
rep(i,h)rep(j,w)cin>>a[i][j];
rep(i,h){
rep(j,w){
sh[i]+=a[i][j];
sw[j]+=a[i][j];
}
}
rep(i,h){
rep(j,w){
cout<<sh[i]+sw[j]-a[i][j]<<' ';
}cout<<endl;
}
}
Submission Info
Submission Time |
|
Task |
004 - Cross Sum(★2) |
User |
Rho17 |
Language |
C++ 20 (gcc 12.2) |
Score |
2 |
Code Size |
592 Byte |
Status |
AC |
Exec Time |
624 ms |
Memory |
44224 KiB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
2 / 2 |
Status |
|
|
Set Name |
Test Cases |
Sample |
sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt |
All |
hand01.txt, hand02.txt, hand03.txt, hand04.txt, random01.txt, random02.txt, random03.txt, random04.txt, random05.txt, random06.txt, random07.txt, random08.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt |
Case Name |
Status |
Exec Time |
Memory |
hand01.txt |
AC |
1 ms |
3484 KiB |
hand02.txt |
AC |
6 ms |
11408 KiB |
hand03.txt |
AC |
1 ms |
3524 KiB |
hand04.txt |
AC |
624 ms |
44224 KiB |
random01.txt |
AC |
54 ms |
8060 KiB |
random02.txt |
AC |
215 ms |
17796 KiB |
random03.txt |
AC |
126 ms |
9932 KiB |
random04.txt |
AC |
167 ms |
17056 KiB |
random05.txt |
AC |
4 ms |
3980 KiB |
random06.txt |
AC |
39 ms |
8576 KiB |
random07.txt |
AC |
551 ms |
39424 KiB |
random08.txt |
AC |
115 ms |
11876 KiB |
sample_01.txt |
AC |
1 ms |
3452 KiB |
sample_02.txt |
AC |
1 ms |
3508 KiB |
sample_03.txt |
AC |
1 ms |
3608 KiB |
sample_04.txt |
AC |
1 ms |
3640 KiB |