結果

問題 No.2261 Coffee
ユーザー karinohitokarinohito
提出日時 2023-03-20 00:26:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 458 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 81,812 KB
実行使用メモリ 100,468 KB
最終ジャッジ日時 2023-10-18 17:56:56
合計ジャッジ時間 13,907 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,420 KB
testcase_01 AC 38 ms
53,420 KB
testcase_02 AC 38 ms
53,420 KB
testcase_03 AC 43 ms
53,420 KB
testcase_04 AC 38 ms
53,420 KB
testcase_05 AC 38 ms
53,420 KB
testcase_06 AC 40 ms
53,420 KB
testcase_07 AC 38 ms
53,420 KB
testcase_08 AC 38 ms
53,420 KB
testcase_09 AC 38 ms
53,420 KB
testcase_10 AC 52 ms
64,236 KB
testcase_11 AC 53 ms
64,236 KB
testcase_12 AC 51 ms
64,240 KB
testcase_13 AC 50 ms
62,188 KB
testcase_14 AC 52 ms
64,236 KB
testcase_15 AC 49 ms
62,168 KB
testcase_16 AC 50 ms
62,188 KB
testcase_17 AC 108 ms
76,824 KB
testcase_18 AC 109 ms
76,712 KB
testcase_19 AC 107 ms
76,612 KB
testcase_20 AC 105 ms
76,696 KB
testcase_21 AC 108 ms
76,688 KB
testcase_22 AC 106 ms
76,672 KB
testcase_23 AC 108 ms
76,816 KB
testcase_24 AC 376 ms
99,532 KB
testcase_25 AC 458 ms
95,980 KB
testcase_26 AC 386 ms
100,136 KB
testcase_27 AC 376 ms
99,320 KB
testcase_28 AC 304 ms
95,844 KB
testcase_29 AC 306 ms
96,044 KB
testcase_30 AC 262 ms
91,224 KB
testcase_31 AC 353 ms
99,736 KB
testcase_32 AC 364 ms
99,784 KB
testcase_33 AC 342 ms
99,692 KB
testcase_34 AC 346 ms
99,712 KB
testcase_35 AC 359 ms
99,780 KB
testcase_36 AC 342 ms
99,744 KB
testcase_37 AC 348 ms
99,748 KB
testcase_38 AC 384 ms
100,468 KB
testcase_39 AC 398 ms
100,272 KB
testcase_40 AC 410 ms
100,324 KB
testcase_41 AC 398 ms
100,352 KB
testcase_42 AC 385 ms
100,280 KB
testcase_43 AC 404 ms
100,288 KB
testcase_44 AC 402 ms
100,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = []
for i in range(N):
    row = list(map(int, input().split()))
    A.append(row)

AN = [0] * N
for bit in range(1<<4):
    F=[0]*N
    M=-1000000000000000000
    m=1000000000000000000
    for i in range(N):
        for j in range(5):
            if(bit&(1<<j)):
                F[i]=F[i]+A[i][j]
            else:
                F[i]=F[i]-A[i][j]
        M=max(M,F[i])
        m=min(m,F[i])
    for i in range(N):
        AN[i]=max(AN[i],F[i]-m)
        AN[i]=max(AN[i],M-F[i])

for i in range(N):
    print(AN[i])

0