結果

問題 No.1060 素敵な宝箱
ユーザー とりゐとりゐ
提出日時 2021-09-14 13:45:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 485 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 77,904 KB
最終ジャッジ日時 2023-09-09 10:27:28
合計ジャッジ時間 4,543 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,424 KB
testcase_01 AC 69 ms
71,368 KB
testcase_02 AC 72 ms
71,440 KB
testcase_03 AC 69 ms
71,460 KB
testcase_04 AC 68 ms
71,176 KB
testcase_05 AC 70 ms
71,124 KB
testcase_06 AC 68 ms
71,404 KB
testcase_07 AC 68 ms
71,180 KB
testcase_08 AC 76 ms
76,420 KB
testcase_09 AC 76 ms
76,204 KB
testcase_10 AC 73 ms
76,348 KB
testcase_11 AC 75 ms
76,344 KB
testcase_12 AC 85 ms
77,076 KB
testcase_13 AC 82 ms
76,884 KB
testcase_14 AC 82 ms
76,792 KB
testcase_15 AC 85 ms
77,904 KB
testcase_16 AC 83 ms
77,096 KB
testcase_17 AC 77 ms
76,128 KB
testcase_18 AC 86 ms
77,104 KB
testcase_19 AC 85 ms
76,680 KB
testcase_20 AC 90 ms
77,756 KB
testcase_21 AC 89 ms
77,860 KB
testcase_22 AC 91 ms
77,860 KB
testcase_23 AC 86 ms
76,792 KB
testcase_24 AC 91 ms
77,780 KB
testcase_25 AC 91 ms
77,784 KB
testcase_26 AC 89 ms
77,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
cnt=[0]*m
a=[]
for i in range(n):
  b=list(map(int,input().split()))
  a.append(b)
  for j in range(m):
    cnt[j]+=b[j]
c=[]
for i in range(n):
  tmp=0
  for j in range(m):
    tmp+=cnt[j]*a[i][j]
  c.append(tmp)
c.sort()
print(sum(c[1::2])-sum(c[::2]))
0