結果

問題 No.2509 Beam Shateki
ユーザー fiblonariafiblonaria
提出日時 2023-11-03 08:01:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 62,312 KB
最終ジャッジ日時 2023-11-03 08:01:35
合計ジャッジ時間 5,375 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,580 KB
testcase_01 WA -
testcase_02 AC 37 ms
53,580 KB
testcase_03 AC 45 ms
62,312 KB
testcase_04 AC 47 ms
62,312 KB
testcase_05 AC 48 ms
62,312 KB
testcase_06 AC 46 ms
62,312 KB
testcase_07 AC 45 ms
62,312 KB
testcase_08 AC 45 ms
62,312 KB
testcase_09 AC 45 ms
62,312 KB
testcase_10 AC 45 ms
62,312 KB
testcase_11 AC 44 ms
62,312 KB
testcase_12 AC 45 ms
62,312 KB
testcase_13 AC 48 ms
62,312 KB
testcase_14 AC 47 ms
62,312 KB
testcase_15 AC 48 ms
62,312 KB
testcase_16 WA -
testcase_17 AC 48 ms
62,312 KB
testcase_18 AC 51 ms
62,312 KB
testcase_19 AC 47 ms
62,312 KB
testcase_20 AC 47 ms
62,312 KB
testcase_21 WA -
testcase_22 AC 48 ms
62,312 KB
testcase_23 AC 47 ms
62,312 KB
testcase_24 AC 46 ms
62,312 KB
testcase_25 AC 46 ms
62,312 KB
testcase_26 AC 45 ms
62,312 KB
testcase_27 AC 45 ms
62,312 KB
testcase_28 AC 46 ms
62,312 KB
testcase_29 AC 47 ms
62,312 KB
testcase_30 AC 47 ms
62,312 KB
testcase_31 WA -
testcase_32 AC 46 ms
62,312 KB
testcase_33 AC 38 ms
53,580 KB
testcase_34 AC 46 ms
62,312 KB
testcase_35 AC 46 ms
62,312 KB
testcase_36 AC 44 ms
60,264 KB
testcase_37 AC 39 ms
53,580 KB
testcase_38 AC 46 ms
62,312 KB
testcase_39 AC 45 ms
60,264 KB
testcase_40 AC 46 ms
62,312 KB
testcase_41 AC 36 ms
53,580 KB
testcase_42 AC 45 ms
62,312 KB
testcase_43 AC 46 ms
62,312 KB
testcase_44 AC 46 ms
62,312 KB
testcase_45 AC 45 ms
60,264 KB
testcase_46 AC 45 ms
62,312 KB
testcase_47 AC 46 ms
62,312 KB
testcase_48 AC 45 ms
62,312 KB
testcase_49 AC 46 ms
62,312 KB
testcase_50 AC 47 ms
62,312 KB
testcase_51 AC 38 ms
53,580 KB
testcase_52 AC 45 ms
62,312 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 36 ms
53,580 KB
testcase_56 AC 37 ms
53,580 KB
testcase_57 AC 41 ms
53,580 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
A = [list(map(int, input().split())) for i in range(H)]
B = [0 for i in range(H)]
C = [0 for i in range(W)]
for i in range(H):
    for j in range(W):
        C[j] += A[i][j]
        B[i] += A[i][j]
ans = -float('inf')
if H >= 2:
    ans = max(sum(sorted(B)[-2:]), ans)
if W >= 2:
    ans = max(sum(sorted(C)[-2:]), ans)
for i in range(H):
    for j in range(W):
        ans = max(C[j] + B[i] - A[i][j], ans)
print(ans)
0