結果

問題 No.2918 Divide Applicants Fairly
ユーザー 高橋ゆに高橋ゆに
提出日時 2024-09-24 17:37:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 492 bytes
コンパイル時間 545 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 247,356 KB
最終ジャッジ日時 2024-10-07 11:33:20
合計ジャッジ時間 13,709 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,840 KB
testcase_01 AC 40 ms
51,840 KB
testcase_02 AC 39 ms
51,584 KB
testcase_03 AC 39 ms
51,456 KB
testcase_04 AC 39 ms
52,224 KB
testcase_05 AC 47 ms
57,984 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 39 ms
51,968 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 39 ms
51,456 KB
testcase_16 AC 39 ms
51,944 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 39 ms
51,712 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 39 ms
51,840 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 39 ms
51,840 KB
testcase_31 WA -
testcase_32 AC 39 ms
52,096 KB
testcase_33 AC 39 ms
51,584 KB
testcase_34 AC 39 ms
52,224 KB
testcase_35 AC 39 ms
51,840 KB
testcase_36 AC 302 ms
112,868 KB
testcase_37 AC 175 ms
95,616 KB
testcase_38 AC 116 ms
83,584 KB
testcase_39 AC 39 ms
52,224 KB
testcase_40 AC 115 ms
83,200 KB
testcase_41 AC 175 ms
95,104 KB
testcase_42 AC 298 ms
112,868 KB
testcase_43 AC 531 ms
128,464 KB
testcase_44 AC 1,003 ms
153,136 KB
testcase_45 AC 1,755 ms
246,964 KB
testcase_46 AC 38 ms
51,712 KB
testcase_47 AC 39 ms
51,840 KB
testcase_48 AC 58 ms
64,256 KB
testcase_49 AC 175 ms
94,976 KB
testcase_50 AC 39 ms
51,712 KB
testcase_51 AC 58 ms
64,512 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 66 ms
67,328 KB
testcase_55 AC 80 ms
72,960 KB
testcase_56 AC 79 ms
72,448 KB
testcase_57 WA -
testcase_58 AC 79 ms
72,448 KB
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

if N > 25:
    print(0)
    exit()

rates = list(map(int, input().split()))
rates.sort()
rate_sums = []
for comb in range(1, 1 << N):
    if comb.bit_count() != N // 2:
        continue
    
    rate_sum = 0
    for i in range(N):
        if (comb >> i) & 1: rate_sum += rates[i]
    rate_sums.append(rate_sum)

ans = 2 ** 30
for i in range(len(rate_sums) - 1):
    if ans > abs(rate_sums[i] - rate_sums[i + 1]):
        ans = abs(rate_sums[i] - rate_sums[i + 1])
print(ans)
0