結果

問題 No.1060 素敵な宝箱
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-06-24 12:43:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 372 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 77,744 KB
最終ジャッジ日時 2023-09-07 13:22:02
合計ジャッジ時間 4,011 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,224 KB
testcase_01 AC 66 ms
71,316 KB
testcase_02 AC 67 ms
71,188 KB
testcase_03 AC 64 ms
71,196 KB
testcase_04 AC 68 ms
71,384 KB
testcase_05 AC 64 ms
71,328 KB
testcase_06 AC 66 ms
71,220 KB
testcase_07 AC 66 ms
71,500 KB
testcase_08 AC 69 ms
76,092 KB
testcase_09 AC 71 ms
76,028 KB
testcase_10 AC 72 ms
75,924 KB
testcase_11 AC 71 ms
76,028 KB
testcase_12 AC 75 ms
76,324 KB
testcase_13 AC 78 ms
76,484 KB
testcase_14 AC 79 ms
76,628 KB
testcase_15 AC 82 ms
77,544 KB
testcase_16 AC 77 ms
76,316 KB
testcase_17 AC 72 ms
76,124 KB
testcase_18 AC 79 ms
76,456 KB
testcase_19 AC 78 ms
76,488 KB
testcase_20 AC 80 ms
76,200 KB
testcase_21 AC 78 ms
76,356 KB
testcase_22 AC 77 ms
76,356 KB
testcase_23 AC 76 ms
76,472 KB
testcase_24 AC 81 ms
77,744 KB
testcase_25 AC 83 ms
77,464 KB
testcase_26 AC 83 ms
77,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main1(n,m,a):
  ary=[0]*m
  for x in a:
    for j in range(m):
      ary[j]+=x[j]
  b=[]
  for x in a:
    tmp=0
    for j in range(m):
      tmp+=x[j]*ary[j]
    b.append(tmp)
  b.sort()
  x=sum([v for v in b[::2]])
  y=sum([v for v in b[1::2]])
  return abs(x-y)
if __name__=='__main__':
  n,m=map(int,input().split())
  a=[list(map(int,input().split())) for _ in range(n)]
  ret1=main1(n,m,a)
  print(ret1)
0