提出 #25902674


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, n) for (int i = 0; i < (int)n; i++)
#define REP(i, n) FOR(i, 0, n)

int H, W;
int A[2001][2001];
int row[2001];
int col[2001];

int main() {
  cin >> H >> W;
  REP(h, H) REP(w, W) {
    cin >> A[h][w];
    row[h] += A[h][w];
    col[w] += A[h][w];
  }
  REP(h, H) REP(w, W) {
    cout << (row[h] + col[w] - A[h][w]) << (w == (W-1) ? "\n" : " ");
  }

  return 0;
}

提出情報

提出日時
問題 004 - Cross Sum(★2)
ユーザ ryo_ryo66
言語 C++ (GCC 9.2.1)
得点 2
コード長 452 Byte
結果 AC
実行時間 722 ms
メモリ 44136 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 7 ms 3544 KiB
hand02.txt AC 10 ms 11548 KiB
hand03.txt AC 3 ms 3580 KiB
hand04.txt AC 722 ms 44136 KiB
random01.txt AC 73 ms 8124 KiB
random02.txt AC 257 ms 17832 KiB
random03.txt AC 162 ms 10000 KiB
random04.txt AC 212 ms 16996 KiB
random05.txt AC 11 ms 3688 KiB
random06.txt AC 56 ms 8468 KiB
random07.txt AC 639 ms 39240 KiB
random08.txt AC 144 ms 11904 KiB
sample_01.txt AC 6 ms 3552 KiB
sample_02.txt AC 4 ms 3484 KiB
sample_03.txt AC 2 ms 3420 KiB
sample_04.txt AC 2 ms 3572 KiB