提出 #58762983


ソースコード 拡げる

#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;
    }
}

提出情報

提出日時
問題 004 - Cross Sum(★2)
ユーザ Rho17
言語 C++ 20 (gcc 12.2)
得点 2
コード長 592 Byte
結果 AC
実行時間 624 ms
メモリ 44224 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 2 / 2
結果
AC × 4
AC × 16
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
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