結果

問題 No.1060 素敵な宝箱
ユーザー hir355hir355
提出日時 2020-05-22 22:22:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-04-15 17:20:53
合計ジャッジ時間 2,418 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 31 ms
10,880 KB
testcase_06 AC 31 ms
10,880 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 33 ms
10,880 KB
testcase_09 AC 33 ms
10,752 KB
testcase_10 AC 33 ms
10,752 KB
testcase_11 AC 33 ms
10,752 KB
testcase_12 AC 48 ms
11,136 KB
testcase_13 AC 56 ms
11,008 KB
testcase_14 AC 60 ms
11,136 KB
testcase_15 AC 81 ms
11,520 KB
testcase_16 AC 67 ms
11,264 KB
testcase_17 AC 46 ms
11,008 KB
testcase_18 AC 53 ms
11,136 KB
testcase_19 AC 52 ms
11,008 KB
testcase_20 AC 73 ms
11,264 KB
testcase_21 AC 71 ms
11,392 KB
testcase_22 AC 71 ms
11,264 KB
testcase_23 AC 52 ms
11,136 KB
testcase_24 AC 95 ms
11,648 KB
testcase_25 AC 94 ms
11,520 KB
testcase_26 AC 92 ms
11,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
l = [0] * m
for i in range(n):
    for j in range(m):
        l[j] += a[i][j]
p = [0] * n
for i in range(n):
    for j in range(m):
        p[i] += a[i][j] * l[j]
p.sort(reverse=True)
print(sum(p[::2]) - sum(p[1::2]))
0