結果

問題 No.949 飲酒プログラミングコンテスト
ユーザー りあんりあん
提出日時 2019-12-06 06:43:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 772 ms / 2,500 ms
コード長 441 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 78,572 KB
最終ジャッジ日時 2023-09-06 07:53:16
合計ジャッジ時間 10,754 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,484 KB
testcase_01 AC 76 ms
71,416 KB
testcase_02 AC 78 ms
71,544 KB
testcase_03 AC 76 ms
71,328 KB
testcase_04 AC 82 ms
75,632 KB
testcase_05 AC 90 ms
75,700 KB
testcase_06 AC 86 ms
75,820 KB
testcase_07 AC 95 ms
75,844 KB
testcase_08 AC 110 ms
77,692 KB
testcase_09 AC 100 ms
75,984 KB
testcase_10 AC 97 ms
76,764 KB
testcase_11 AC 590 ms
78,036 KB
testcase_12 AC 562 ms
78,060 KB
testcase_13 AC 534 ms
78,572 KB
testcase_14 AC 176 ms
78,000 KB
testcase_15 AC 279 ms
77,724 KB
testcase_16 AC 456 ms
77,664 KB
testcase_17 AC 136 ms
77,372 KB
testcase_18 AC 590 ms
77,956 KB
testcase_19 AC 262 ms
78,052 KB
testcase_20 AC 146 ms
77,536 KB
testcase_21 AC 118 ms
77,688 KB
testcase_22 AC 116 ms
77,548 KB
testcase_23 AC 81 ms
75,600 KB
testcase_24 AC 343 ms
77,740 KB
testcase_25 AC 772 ms
78,044 KB
testcase_26 AC 679 ms
78,060 KB
testcase_27 AC 467 ms
77,952 KB
testcase_28 AC 539 ms
77,740 KB
testcase_29 AC 322 ms
77,756 KB
testcase_30 AC 186 ms
77,900 KB
testcase_31 AC 117 ms
77,448 KB
testcase_32 AC 526 ms
77,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = list(map(int, input().split()))

d.sort()

ok = 0
ng = n + 1
while ng - ok > 1:
    m = (ok + ng) // 2
    f = [ True ]
    for i in range(1, m + 1):
        f = [ a[j] + b[i - j] >= d[m - i] and (j < i and f[j] or j > 0 and f[j - 1]) for j in range(i + 1) ]

    if any(f):
        ok = m
    else:
        ng = m

print(ok)
0