結果

問題 No.3325 陰陽師
コンテスト
ユーザー 高橋ゆに
提出日時 2025-07-21 20:13:27
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 758 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 160,376 KB
最終ジャッジ日時 2025-11-01 02:53:24
合計ジャッジ時間 15,012 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

STAND_TOTAL, CASE_TOTAL = map(int, input().split())
STRENGTHS = list(map(int, input().split()))
TIMES = list(map(int, input().split()))

def main():
    STRENGTHS.sort()
    
    ok, ng = 0, CASE_TOTAL + 1
    while abs(ok - ng) > 1:
        med = (ok + ng) // 2
        if judge(med):
            ok = med
        else:
            ng = med
    
    print(ok)

def judge(x):
    if x == 0:
        return True
        
    sub_times = [TIMES[case_i] for case_i in range(x)]
    sub_times.sort()
        
    case_i = 0
    for strength in STRENGTHS:
        time = sub_times[case_i]
        if strength >= time:
            case_i += 1
            if case_i >= x:
                break
        
    return case_i >= x

if __name__ == "__main__":
    main()
0